Exemplo n.º 1
0
 public override void Collide(Actor other, Rectangle collision)
 {
     if (other.GetType().IsAssignableFrom(typeof(StandardShip)) &&
                     !Immortal)
     {
         Die();
     }
 }
Exemplo n.º 2
0
 public override void Collide(Actor other, Rectangle collision)
 {
     if (Dying) { return; }
     if (other.GetType().IsAssignableFrom(typeof(StandardShip)))
     {
         Die();
         return;
     }
 }
Exemplo n.º 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;
            }
        }
Exemplo n.º 4
0
 public virtual void Collide(Actor other, Rectangle collision)
 {
 }
Exemplo n.º 5
0
 public static void CheckOut(Actor actor)
 {
     actor.CleanUp();
     Actors.Remove(actor);
     actor = null;
 }
Exemplo n.º 6
0
 public static void CheckIn(Actor actor)
 {
     Actors.Add(actor);
 }
Exemplo n.º 7
0
 static void CheckCollision(Actor actor, Actor other)
 {
     var collision = Rectangle.Intersect(actor.Box, other.Box);
     var inverseCollision = Rectangle.Intersect(other.Box, actor.Box);
     if (!collision.IsEmpty && !actor.Dying && !other.Dying)
     {
         actor.Collide(other, collision);
         other.Collide(actor, inverseCollision);
     }
 }
Exemplo n.º 8
0
 public static void CheckOut(Actor actor)
 {
     Actors.Remove(actor);
 }