Esempio n. 1
0
 public void DetectCollisions(Player player, AlienManager aliens, UFOManager ufo)
 {
     aliens.DetectCollision(player.bullets(), player);
     ufo.DetectCollision(player.bullets(), player.level);
     if (player.DetectCollision(ufo.Gift()))
     {
         ufo.CatchGift(player);
     }
     player.DetectCollision(aliens.bullets());
 }
Esempio n. 2
0
 public void Draw(SpriteBatch sprBatch, Starfield stars, Player player, AlienManager aliens, UFOManager ufo, bool drawNPCs, bool drawShip)
 {
     stars.Draw(sprBatch);
     if (drawShip)
     {
         player.Draw(sprBatch);
         foreach (Sprite pB in player.bullets())
         {
             pB.Draw(sprBatch);
         }
     }
     if (drawNPCs)
     {
         foreach (Sprite eB in aliens.bullets())
         {
             eB.Draw(sprBatch, (float)Math.PI, Color.Red);
         }
         foreach (Sprite a in aliens.alienList())
         {
             a.Draw(sprBatch);
         }
         if (!ufo.Caught())
         {
             ufo.Draw(sprBatch);
         }
     }
     sprBatch.Draw(mPanel, new Vector2(1080, 0), Color.White);
     sprBatch.DrawString(fontHeader, ("Level   " + player.level), new Vector2(1120, 19), Color.IndianRed);
     sprBatch.DrawString(fontHeader, ("Score"), new Vector2(1135, 95), Color.CadetBlue);
     sprBatch.DrawString(fontData, ("" + player.score), new Vector2(1135, 140), Color.White);
     sprBatch.DrawString(fontHeader, ("Lives:"), new Vector2(1120, 235), Color.CadetBlue);
     sprBatch.DrawString(fontData, ("" + player.lives), new Vector2(1220, 235), Color.White);
     sprBatch.DrawString(fontHeader, ("Ship Speed"), new Vector2(1100, 325), Color.ForestGreen);
     sprBatch.DrawString(fontData, ("" + player.Speed), new Vector2(1162, 374), Color.White);
     sprBatch.DrawString(fontHeader, ("Max Bullets"), new Vector2(1099, 460), Color.ForestGreen);
     sprBatch.DrawString(fontData, ("" + player.maxBullets + " / 8"), new Vector2(1150, 509), Color.White);
     sprBatch.DrawString(fontHeader, ("Bullet Speed"), new Vector2(1095, 600), Color.ForestGreen);
     sprBatch.DrawString(fontData, ("" + player.bulletSpeed), new Vector2(1166, 649), Color.White);
     if (drawNPCs && ufo.Caught())
     {
         ufo.Draw(sprBatch);
     }
 }