Exemplo n.º 1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        Attacker attacker = collision.gameObject.GetComponent <Attacker>();

        if (attacker)
        {
            if (_lives.Count > 0)
            {
                _lives.Decrease(GameConfiguration.BASE_ATTACK_DAMAGE);
            }

            attacker.GetComponent <Health>().InstaDeath();
        }

        Destroy(collision.gameObject);
    }
Exemplo n.º 2
0
 void CrashedState()
 {
     lives.Decrease(1);
     display.Crashed(_state.playerPos);
     sound.Crashed();
     //kenemies.Reset(); //TEST QUIZAS NO SE DEBA RESETEAR
     if (lives.Left())
     {
         SetState("playing");
     }
     else
     {
         bat.GameOver();
         display.GameOver();
         sound.GameOver();
         timeToMainMenu = CurrentTime() + gameOverWait;
         SetState("gameOver");
     }
 }