Exemple #1
0
 private void ChangeState(int newState)
 {
     if (newState == 0)
     {
         level.ResetLevel();
         hud.ResetHUD(newState);
         gameState = 0;
     }
     else if (newState == 1)
     {
         if (gameState == 0 || gameState == 4)
         {
             level.ResetLevel();
         }
         hud.ResetHUD(newState);
         gameState = 1;
     }
     else if (newState == 2)
     {
         hud.ResetHUD(newState);
         gameState = 2;
     }
     else if (newState == 3)
     {
         hud.ResetHUD(newState);
         gameState = 3;
     }
     else if (newState == 4)
     {
         hud.ResetHUD(newState);
         gameState = 4;
     }
     else if (newState == 5)
     {
         gameState = 5;
         level.player.jetpackSoundEffect.Stop();
         level.ResetLevel();
         hud.ResetHUD(newState);
     }
     //Exit option
     else
     {
         this.Exit();
     }
 }
 private void KillPlayer()
 {
     playerAlive = false;
     //HUD reset for pause is the same for death
     hud.ResetHUD(3);
 }