Пример #1
0
    public void UpdateCollision()
    {
        // if the tile is no the same tile as pacman OR
        // if the the ghost is respawning don't check for collision
        if (currentMode == Modes.Respawning || tile != player.tile)
        {
            return;
        }

        // Check if the ghost is in fright mode.
        if (currentMode == Modes.Frightened)
        {
            gameController.StartCoroutine(gameController.Pause(1f));
            Death();
        }
        else
        {
            if (houseMode == HouseModes.None && player.isAlive)
            {
                gameController.StartCoroutine(gameController.Pause(1f));
                gameController.blinky.StopAllCoroutines();
                gameController.pinky.StopAllCoroutines();
                gameController.inky.StopAllCoroutines();
                gameController.clyde.StopAllCoroutines();
                player.Death();
            }
        }
    }