コード例 #1
0
ファイル: GameStateManager.cs プロジェクト: jensj12/MeesGame
 public void HandleInput(InputHelper inputHelper)
 {
     //If P is pressed, and you're not currently in the settings menu, the settings menu will be opened,
     //and the gamestate where you came from will be stored for potential use
     if (inputHelper.KeyPressed(Keys.P))
     {
         if (currentGameState.ToString() == "MeesGame.SettingsMenuState")
         {
             SwitchTo(previousGameState);
         }
         else
         {
             previousGameState = currentGameState.ToString();
             SwitchTo("SettingsMenuState");
         }
     }
     if (inputHelper.KeyPressed(Keys.Escape))
     {
         SwitchTo("TitleMenuState");
     }
     if (currentGameState != null)
     {
         currentGameState.HandleInput(inputHelper);
     }
 }