Пример #1
0
 private StateManager(Game game)
 {
     mState = GameState.MAIN_MENU;
     mMenuState = new MainMenu(game);
     mPlayState = new GameManager(game,1);
     mPauseState = new PauseState(game);
     mSettingsState = new SettingsState(game);
     mDeadState = new DeadState(game);
     mResultState = new ResultState(mGame, 0, 0, Score.AlphaScore.F, "");
     mGame = game;
 }
Пример #2
0
 public void ChangePlayStateLevel(int level)
 {
     mPlayState = new GameManager(mGame, level);
 }
Пример #3
0
 public void ResetState(GameState stateToReset)
 {
     switch (stateToReset)
     {
         case GameState.MAIN_MENU:
             mMenuState = new MainMenu(mGame);
             break;
         case GameState.SETTINGS:
             mSettingsState = new SettingsState(mGame);
             break;
         case GameState.PLAY:
             mPlayState = new GameManager(mGame, mPlayState.CurrentLevel);
             break;
         case GameState.DEAD_SCREEN:
             mDeadState = new DeadState(mGame);
             break;
     }
 }
Пример #4
0
 public void IncreasePlayLevel()
 {
     mPlayState.StopMusic();
     if (mPlayState.CurrentLevel < 2)
     {
         mPlayState = new GameManager(mGame, mPlayState.CurrentLevel + 1);
         mState = GameState.PLAY;
     }
     else
     {
         ChangePlayStateLevel(1);
         SetState(GameState.MAIN_MENU);
     }
 }