Esempio n. 1
0
 public void takeDamage(Organism attacker, float amount)
 {
     _health -= amount;
     if (_health <= 0)
     {
         state = State.Dead;
         attacker.setState(State.Idle);
         attacker.setTarget(null);
         if (!_flyingOff)
         {
             flyOff();
         }
     }
 }
Esempio n. 2
0
 public void takeDamage(Organism attacker, float amount)
 {
     health -= amount;
     if (health <= 0)
     {
         state = Hero.State.Dead;
         attacker.setState(Hero.State.Idle);
         setSprite(4);
         attacker.setTarget(null);
         if (!dying)
         {
             die();
         }
     }
 }