示例#1
0
 public void onHitting(EnemyEntity other)
 {
     other.Health -= Attack;
     Vector2 knockbackVelocity = other.Position - position;
     knockbackVelocity.Normalize();
     knockbackVelocity *= 4f;
     other.setKnockback(knockbackVelocity);
     enemyHit.Play();
 }
示例#2
0
 public void onGettingHit(EnemyEntity other)
 {
     Health -= other.Attack;
     Vector2 knockbackVelocity = position - other.Position;
     knockbackVelocity.Normalize();
     knockbackVelocity *= 4f;
     setKnockback(knockbackVelocity);
     playerHit.Play();
 }