public override void OnKnockbackEnd() { Velocity = Vector2.Zero; if (!IsAlive) { KnockbackAnimation.Play("Death"); } }
public virtual void OnKnockbackEnd() { Velocity = Vector2.Zero; if (!IsAlive) { KnockbackAnimation.Play("Death"); CollisionLayer = 0; CollisionMask = 0; } }
public virtual void Damage(Vector2 direction) { if (!CanBeDamaged) { return; } if (IsInvulnerable) { return; } if (!IsAlive) { return; } IsInvulnerable = true; Velocity = direction * 30; InvulnerabilityTimer.Start(); KnockbackAnimation.Play("Knockback"); Health -= 1; OnTakeDamage(); }