Пример #1
0
 public override void Collide(Actor other, Rectangle collision)
 {
     if (other.GetType().IsAssignableFrom(typeof(StandardShip)) &&
                     !Immortal)
     {
         Die();
     }
 }
Пример #2
0
 public override void Collide(Actor other, Rectangle collision)
 {
     if (Dying) { return; }
     if (other.GetType().IsAssignableFrom(typeof(StandardShip)))
     {
         Die();
         return;
     }
 }
Пример #3
0
        public override void Collide(Actor other, Rectangle collision)
        {
            if (Dying)
            {
                return;
            }

            if (other.GetType() == typeof(MainShip))
            {
                Die();
                return;
            }

            if (other.GetType() == typeof(Bullet))
            {
                var theBullet = (Bullet)other;
                TakeDamage(theBullet.Power);
                Flashing = true;
            }
        }