Exemple #1
0
 public override void resolveCollision(CommandCenter collider)
 {
     if (boxCollider.Intersects(collider.boxCollider))
     {
         if (Player != collider)
         {
             collider.Hit();
             Player._currentActive = null;
             isAlive = false;
         }
     }
 }
Exemple #2
0
 public override void resolveCollision(CommandCenter collider)
 {
     if (boxCollider.Intersects(collider.boxCollider))
     {
         if (Player != collider)
         {
             collider.Hit();
             Player._currentActive = null;
             isAlive = false;
             GameScreen.particleSystem.AddExplosion(_position);
         }
     }
 }
Exemple #3
0
        public void resolveCollision(CommandCenter collider)
        {
            if (!isAlive)
            {
                return;
            }

            float distance = (_position - collider.Position).Length();

            if (!(distance < radius + collider.radius))
            {
                return;
            }

            collider.Hit();
            GameScreen.deadAsteroids.Enqueue(this);
            isAlive = false;
            GameScreen.currentNumAsteroids--;
        }