示例#1
0
        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);
 }
示例#3
0
 public bool IsCollidingWith(GameObject gameObject)
 {
     return Bounds.IntersectsWith(gameObject.Bounds);
 }
示例#4
0
 public virtual void CollideWith(GameObject gameObject)
 {
 }