Exemplo n.º 1
0
 public void takeDamage(Vector3 dir, float value, int damage)
 {
     if (current_hp > 0 && !isInvincible && !hurtInvincible)
     {
         ScreenEffects.Shake();
         for (int i = 0; i < damage; i++)
         {
             HP_UI.damageHeart();
             current_hp--;
             hurtInvincible = true;
         }
         hurt      = true;
         hurtTimer = 0.1f;
         Vector2 kb_dir = new Vector2(transform.position.x - dir.x, transform.position.y - dir.y);
         rb.velocity = (kb_dir * value);
     }
 }
Exemplo n.º 2
0
 public void takeDamage()
 {
     HP_UI.damageHeart();
     current_hp--;
 }