Beispiel #1
0
        public static void UpdatePause()
        {
            // Paused to plays.
            var gamePadData = GamePad.GetData (0);
            if((gamePadData.Buttons & GamePadButtons.Triangle)!= 0){

                hud = new HUD(graphics);
                currentState = GameStates.Playing;
            }
        }
Beispiel #2
0
 public static void NewGame()
 {
     // HUD.cs initializing.
     hud = new HUD(graphics);
     // Hero ship initializer.
     Hero = new HeroShip(graphics);
     // List Alien ships.
     Alienator = new List<AlienShip>();
     // A connected variables for each alien ships.
     AlienShip m;
     // Here add enemy ships.
     m = new AlienShip(graphics, graphics.Screen.Rectangle.Width - 100,
                   graphics.Screen.Rectangle.Height / 2, 4);
     Alienator.Add(m);
     m = new AlienShip(graphics, graphics.Screen.Rectangle.Width - 150,
                   graphics.Screen.Rectangle.Height / 2 + 150, 2);
     Alienator.Add(m);
     m = new AlienShip(graphics, graphics.Screen.Rectangle.Width - 50,
                   graphics.Screen.Rectangle.Height / 2 - 100, 6);
     Alienator.Add(m);
     m = new AlienShip(graphics, graphics.Screen.Rectangle.Width - 50,
                   graphics.Screen.Rectangle.Height / 2 - 200, 5);
     Alienator.Add(m);
     // Alien generating.
     alienTimeCounter = 0;
     // Missile generating.
     missile = new List<Projectile>();
     // Shot timer.
     ShotTimer = 0;
     // Explosion here.
     Explosions = new List<explosion>();
 }