示例#1
0
    /// <summary>
    /// Updates the game's status after a pair of matching penguins has been created.
    /// </summary>
    /// <param name="penguin1">The first penguin.</param>
    /// <param name="penguin2">The second penguin.</param>
    public void PairFound(MovableAnimal penguin1, MovableAnimal penguin2)
    {
        int penguinType = MathHelper.Max(penguin1.AnimalIndex, penguin2.AnimalIndex);

        pairList.AddPair(penguinType);

        // if the level has been completed, notify the playing state
        if (pairList.Completed)
        {
            PlayingState playingState = (PlayingState)ExtendedGame
                                        .GameStateManager.GetGameState(PenguinPairs.StateName_Playing);
            playingState.LevelCompleted(LevelIndex);
        }
        else
        {
            ExtendedGame.AssetManager.PlaySoundEffect("Sounds/snd_pair");
        }
    }
示例#2
0
    /// <summary>
    /// Updates the game's status after a pair of matching penguins has been created.
    /// </summary>
    /// <param name="penguin1">The first penguin.</param>
    /// <param name="penguin2">The second penguin.</param>
    public void PairFound(MovableAnimal penguin1, MovableAnimal penguin2)
    {
        int penguinType = MathHelper.Max(penguin1.AnimalIndex, penguin2.AnimalIndex);

        pairList.AddPair(penguinType);
    }