/// <summary> /// Listen to when game state change. Disable runner animation when game is paused. /// </summary> /// <param name="sender">Sender.</param> /// <param name="args">Arguments.</param> private void GameStateChanged(object sender, GameStateArgs args) { MinigameStates gameState = args.GetGameState(); if (gameState == MinigameStates.Paused) { MakePlayerVisible(false); } else if (gameState == MinigameStates.Playing) { MakePlayerVisible(true); } }
private void GameStateChange(object sender, GameStateArgs args) { switch (args.GetGameState()) { case MinigameStates.GameOver: PauseParallax(); break; case MinigameStates.Paused: PauseParallax(); break; case MinigameStates.Playing: PlayParallax(); break; } }
//--------------------------------------------------- // OnGameStateChanged() // When the game's state changes, the object may // want to react. //--------------------------------------------------- private void OnGameStateChanged(object sender, GameStateArgs args) { MinigameStates eState = args.GetGameState(); switch (eState) { case MinigameStates.GameOver: // pause the object OnPause(true); break; case MinigameStates.Paused: // pause the object OnPause(true); break; case MinigameStates.Playing: // unpause the object OnPause(false); break; } }