Ejemplo n.º 1
0
    /// <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);
        }
    }
Ejemplo n.º 2
0
    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;
        }
    }
Ejemplo n.º 3
0
    //---------------------------------------------------
    // 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;
        }
    }