示例#1
0
 public void DeadRestartOrGameOver(GameTime gameTime)
 {
     if (level.Mario.HasDied)
     {
         deadCount++;
         deadCount -= level.TotalExtraLives;
         if (level.Mario.Live == 0)
         {
             Sounds.PlaySound(EventSoundEffects.EventSounds.GameOver);
             GameOverState over = new GameOverState();
             gameOverState    = true;
             KeyBoardControls = new GameOverControls(this);
             Feedback.Update(level, gameTime);
             over.Draw(_spriteBatch);
         }
         else
         {
             rest = new LevelRestartState();
             rest.CheckProgress();
             level = new Level(_graphics, "level.csv", Sounds);
             level.DifficultyMode(MenuState.Difficulty);
             KeyBoardControls  = new KeyBoardControls(this);
             GamePadControls   = new GamePadControls(this);
             level.Mario.Live -= deadCount;
             rest.Draw(_spriteBatch);
             MediaPlayer.Resume();
         }
     }
 }
示例#2
0
 public void WonGame()
 {
     if (level.Mario.WonGame)
     {
         WinningGameState win = new WinningGameState();
         win.Draw(_spriteBatch);
         KeyBoardControls = new GameOverControls(this);
     }
 }