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"]); }
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); }
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); }
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); }
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; }
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; }