public void PlayAnimation(Animation animation) { if(Animation == animation) { return; } this.animation = animation; this.frameIndex = 0; this.time = 0.0f; }
public void LoadContent() { boss = content.Load<Texture2D>("IMGS/Tanji"); support = content.Load<Texture2D>("IMGS/JDial"); player = content.Load<Texture2D>("IMGS/NekuIdle"); Attack = content.Load<Texture2D>("IMGS/NekuAtk"); idleSupport = new Animation(support, 0.1f, true, 3); idleAnimation = new Animation(player, 0.1f, true, 6); idleBoss = new Animation(boss, 0.1f, true, 6); Side = new Animation(Attack, 0.1f, true, 14); int positionX = (Level.windowWidth / 2) - (player.Width / 4) -25; int positionY = (Level.windowHeight / 2) - (player.Height / 4) -25; playerPosition = new Vector2((float)positionX, (float)positionY); int SupposX = (Level.windowWidth / 2) - (player.Width / 4)-50; int SupposY = (Level.windowHeight / 2) - (player.Height / 4) -50; SuppPosition = new Vector2((float)SupposX, (float)SupposY); int BossX = (Level.windowWidth / 2) - (player.Width / 4) + 175; int BossY = (Level.windowHeight / 2) - (player.Height / 4) +125; BossPosition = new Vector2((float)BossX, (float)BossY); }