//protected override void UnloadContent() { } public void Update(GameTime gameTime) { switch (gameState.getState()) { case GameState.state.Start: UpdateStartState(); break; case GameState.state.Level: if (!messageMode && !gameOver) { UpdateLevelState(gameTime); } else if (messageMode) { UpdateMessageMode(); } else { // deals with logic for showing the player that they died if (playDeathSound) { deathScreamSound.Play(); playDeathSound = false; } fellDownCounter++; if (fellDownPit && darwin.destination.Width > 0 && darwin.destination.Height > 0 && fellDownCounter > 5) { darwin.destination.Width -= (int)((float)board.getSquareWidth() * 0.1); darwin.destination.Height -= (int)((float)board.getSquareLength() * 0.1); fellDownCounter = 0; } darwin.setDarwinDead(); darwin.setZombie(); UpdateLevelState(gameTime); gameOverCounter++; if (gameOverCounter > 200) { gameState.setState(GameState.state.End); gameOverCounter = 0; } } break; case GameState.state.End: UpdateEndState(); break; } }
public void Update(GameTime gameTime) { switch (gameState.getState()) { case GameState.state.Start: UpdateStartState(); break; case GameState.state.Level: if (!messageMode && !gameOver) { UpdateLevelState(gameTime); } else if (messageMode) { UpdateMessageMode(); } else { if (playDeathSound) { deathScreamSound.Play(); playDeathSound = false; } darwin.setDarwinDead(); darwin.setZombie(); UpdateLevelState(gameTime); gameOverCounter++; if (gameOverCounter > 200) { gameState.setState(GameState.state.End); gameOverCounter = 0; } } break; case GameState.state.End: UpdateEndState(); break; } }