public void Update(GameTime gameTime) { if (!Started) { Start(); } if (!animationQueue.Done) { animationQueue.Update(gameTime); if (game.GameState != MizJam1Game.GameStates.AnimationsPlaying) { oldState = game.GameState; game.GameState = MizJam1Game.GameStates.AnimationsPlaying; } } else if (game.GameState == MizJam1Game.GameStates.AnimationsPlaying) { game.GameState = oldState; } if (game.GameState == MizJam1Game.GameStates.FightPhase && TurnFinished(false)) { game.GameState = MizJam1Game.GameStates.DefensePhase; WakeUpUnits(true); animationQueue.Add(new ShowBannerAnimation(game.TheirTurn, new Rectangle(736, 412, 448, 256), 1f), null); DoEnemyTurn(); } else if (game.GameState == MizJam1Game.GameStates.DefensePhase && TurnFinished(true)) { game.GameState = MizJam1Game.GameStates.FightPhase; animationQueue.Add(new ShowBannerAnimation(game.YourTurn, new Rectangle(736, 412, 448, 256), 1f), null); WakeUpUnits(false); } animationTimer += (float)gameTime.ElapsedGameTime.TotalMilliseconds; if (animationTimer > 256000) { animationTimer -= 256000; } if (!levelOver) { if (levelFinished()) { animationQueue.Add(new ShowBannerAnimation(game.LevelWon, new Rectangle(736, 412, 448, 256), 3f), null); levelOver = true; } else if (levelLost()) { animationQueue.Add(new ShowBannerAnimation(game.LevelLost, new Rectangle(736, 412, 448, 256), 3f), null); levelOver = true; } } }
public void Update() { animationQueue.Update(); }