public void PlayAnimation(Animation animation) { if (Animation == animation) { return; } this.animation = animation; this.frameIndex = 0; this.time = 0.0f; }
public void LoadContent() { enemy = content.Load<Texture2D>("AyyLmao/agumon_attack.fw"); idleAnimation = new Animation(enemy, 0.1f, true); int positionX = (Level.windowWidth / 3) - (enemy.Width / 3); int positionY = (Level.windowHeight / 2) - (enemy.Height / 3); enemyPosition = new Vector2((float)positionX, (float)positionY); spriteenemy.PlayAnimation(idleAnimation); }
public void LoadContent() { supp1 = content.Load<Texture2D>("AyyLmao/agumon_jump.fw"); supp2 = content.Load<Texture2D>("AyyLmao/agumon_attack.fw"); idleAnimation = new Animation(supp1, 0.1f, true); int positionX = (Level.windowWidth / 2) - (supp1.Width / 2); int positionY = (Level.windowHeight / 2) - (supp1.Height / 3); suppPosition = new Vector2((float)positionX, (float)positionY); spritesupp.PlayAnimation(idleAnimation); }
public void LoadContent() { player = content.Load<Texture2D>("AyyLmao/termon_attack.fw"); bike = content.Load<Texture2D>("AyyLmao/termon_attack2.fw"); idleAnimation = new Animation(player, 0.1f, true); bikeAnimation = new Animation(player, 0.1f, true); int positionX = (Level.windowWidth / 2) - (player.Width / 2); int positionY = (Level.windowHeight / 2) - (player.Height / 4); playerPosition = new Vector2((float)positionX, (float)positionY); spritePlayer.PlayAnimation(idleAnimation); }