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