Exemplo n.º 1
0
 public void LifeChecker(float damage, Player player)
 {
     lifePoints -= damage;
     if (lifePoints <= 0)
     {
         death.Explosion();
         Destroy(gameObject);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// When the player collide with an enemy decrement his lifepoints.
 /// if the player doesn't have any lifepoints call the explosion function in the death component and after restart the level.
 /// </summary>
 private void LifeChecker()
 {
     lifePoints--;
     if (lifePoints <= 0)
     {
         death.Explosion();
         GameManager.Instance.RestartLevel();
     }
 }
Exemplo n.º 3
0
    public void LifeChecker(float damage, Player player)
    {
        lifePoints -= damage;
        if (lifePoints <= 0)
        {
            player.enemiesCounter++;

            SoundManager.Instance.PlaySound("EnemyDeath");

            death.Explosion();

            LevelManager.Instance.CheckForEndLevel(player);

            Destroy(gameObject);
        }
    }