public override bool CollidedWithEnemy(EnemyProjectile p)
        {
            if (p.CollisionSpheres != null)
            {
                foreach (BoundingSphere b in p.CollisionSpheres)
                {
                    if (b.Intersects(this.collisionSphere))
                    {
                        return true;
                    }
                }
            }

            if (p.CollisionBoxes != null)
            {
                foreach (BoundingBox b in p.CollisionBoxes)
                {
                    if (b.Intersects(this.collisionSphere))
                    {
                        return true;
                    }
                }
            }

            return false;
        }
示例#2
0
 /// <summary>
 /// Shoot another projectile into the game.
 /// </summary>
 /// <param name="p">The other projectile to be put onto the screen.</param>
 public void Shoot(EnemyProjectile p)
 {
     AssociatedLevel.Waves[AssociatedLevel.CurrentWaveNo].Add(p);
 }
示例#3
0
 /// <summary>
 /// Check whether if the projectile has collided with the player or not.
 /// </summary>
 /// <returns>True if there is a collision.</returns>
 public abstract bool CollidedWithEnemy(EnemyProjectile p);