/// <summary> /// Updates the Game /// </summary> protected override void Update() { switch (gCurrentState) { case eGameState.gsGame: InitializeState(sGameState); gTargetState = sGameState.Update(Window); DisposeState(sGameState); break; case eGameState.gsGameOver: sGameState = new StateGame(); InitializeState(sGameOverState); gTargetState = sGameOverState.Update(Window); DisposeState(sGameOverState); break; case eGameState.gsMainMenu: InitializeState(sMainMenuState); gTargetState = sMainMenuState.Update(Window); DisposeState(sMainMenuState); break; case eGameState.gsQuit: Window.Close(); break; } }
/// <summary> /// Initializes Variables /// </summary> protected override void Initialize() { gCurrentState = eGameState.gsMainMenu; sGameState = new StateGame(); sGameOverState = new StateGameOver(); sMainMenuState = new StateMainMenu(); }