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; }
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; } }