コード例 #1
0
 public Grenade(Unit owner)
     : base(owner)
 {
     animation = new Animation(GameManager.TheGameManager.Content.Load<Texture2D>(Path.Textures.Projectiles + "attacksprites"), Constants.DefaultFrameTime, true);
     animation.addFrame(new Rectangle(0, 0, 16, 16));
     Cast(owner);
 }
コード例 #2
0
        public BulletSpiral(Unit owner)
            : base(owner)
        {
            animation = new Animation(GameManager.TheGameManager.Content.Load<Texture2D>(Path.Textures.Projectiles + "plasmashot"), Constants.DefaultFrameTime, false);
            animation.addFrame(new Rectangle(0, 0, 32, 32));

            Cast(owner);
        }
コード例 #3
0
        public SlimeAbility(Unit owner)
            : base(owner)
        {
            animation = new Animation(GameManager.TheGameManager.Content.Load<Texture2D>(Path.Textures.Units + "slime"), Constants.DefaultFrameTime, true);
            animation.addFrame(new Rectangle(0, 0, 32, 32));

            Cooldown = 3000f;
            Owner.DelayTimer = 9999f;

            originalScale = Owner.Scale;
            Cast(owner);
        }
コード例 #4
0
        public RangedAttack(Unit owner, Texture2D texture, Queue<Vector2> shotAngles, float delay)
            : base(owner)
        {
            animation = new Animation(texture, Constants.DefaultFrameTime, true);
            animation.addFrame(new Rectangle(0, 0, 32, 32));

            while (shotAngles.Count != 0) {
                Vector2 shotAngle = shotAngles.Dequeue();
                Fire(owner, shotAngle);
            }

            Cooldown = 400f;
        }
コード例 #5
0
        private void LoadAnimations()
        {
            Texture2D texture = GameManager.TheGameManager.Content.Load<Texture2D>(Path.Textures.Units + "slayerknight");
            Animation animation = new Animation(texture, 0.08f, false);

            animation = new Animation(texture, 0.08f, true);
            animation.addFrame(new Rectangle(0, 0, 32, 32));
            animation.addFrame(new Rectangle(0, 0, 32, 32));
            Animations.Add("walking", animation);

            // Calculate bounds within texture size.
            base.localBounds = new Rectangle(0, 0, 32, 32);

            sprite.PlayAnimation(Animations["walking"]);
        }
コード例 #6
0
        public Explosion(Vector2 Position, Texture2D texture)
        {
            this.Position = Position + Offset;
            Animation animation = new Animation(texture, 0.015f, false);
            animation.addFrame(new Rectangle(0, 0, 200, 120));
            animation.addFrame(new Rectangle(212, 0, 200, 120));
            animation.addFrame(new Rectangle(424, 0, 200, 120));
            animation.addFrame(new Rectangle(0, 134, 200, 120));
            animation.addFrame(new Rectangle(212, 126, 200, 120));
            animation.addFrame(new Rectangle(424, 126, 200, 120));
            animation.addFrame(new Rectangle(0, 250, 175, 140));
            animation.addFrame(new Rectangle(212, 250, 175, 140));
            animation.addFrame(new Rectangle(424, 250, 175, 140));
            animation.addFrame(new Rectangle(0, 402, 200, 120));
            animation.addFrame(new Rectangle(212, 402, 200, 120));
            sprite.PlayAnimation(animation);

            Scale = 0.6f;
        }