public override void CollideWith(GameObject gameObject) { if (gameObject is Ship) { // Ignore collision with the bullet's own ship if (gameObject != Ship) { (gameObject as Ship).Damage(100); } } if (gameObject is Bullet) { (gameObject as Bullet).Die(); } base.CollideWith(gameObject); }
public void Add(GameObject gameObject) { gameObjects.Add(gameObject); }
public bool IsCollidingWith(GameObject gameObject) { return Bounds.IntersectsWith(gameObject.Bounds); }
public virtual void CollideWith(GameObject gameObject) { }