Exemple #1
0
    void loseALife()
    {
        for (int i = 0; i < gameEntities.Count; i++)
        {
            if (gameEntities[i] is IGameActor)
            {
                tmpActor = gameEntities[i] as IGameActor;
                tmpActor.TakeMessage("PlayerStartDamage");
            }
        }

        if (playerLives > 0)
        {
            playerLives -= 1;
            myUiLogic.uiLoseHealth();
        }

        if (playerLives <= 0)
        {
            playerDie();
        }
    }