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