示例#1
0
 public override void OnKnockbackEnd()
 {
     Velocity = Vector2.Zero;
     if (!IsAlive)
     {
         KnockbackAnimation.Play("Death");
     }
 }
示例#2
0
 public virtual void OnKnockbackEnd()
 {
     Velocity = Vector2.Zero;
     if (!IsAlive)
     {
         KnockbackAnimation.Play("Death");
         CollisionLayer = 0;
         CollisionMask  = 0;
     }
 }
示例#3
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();
        }