Ejemplo n.º 1
0
 static void Main()
 {
     using (var game = new Invaders())
     {
         game.Run();
     }
 }
Ejemplo n.º 2
0
        public Game(Graphics g, Rectangle boundaries)
        {
            //Initialize the stars to plot a black background and to be able to add the stars to the
            //Canvas;
            this.g                 = g;
            this.boundaries.X      = 0;
            this.boundaries.Y      = 0;
            this.boundaries.Height = boundaries.Y;
            this.boundaries.Width  = boundaries.X;



            this.random = new Random();



            //Initializes two collections that keeps track of the shots fired respectively
            this.playerShots = new Shots();
            this.enemyShots  = new Shots();


            this.stars = new Stars(boundaries);
            Point initialPosition = new Point(boundaries.X / 2, boundaries.Y);

            this.playerShip = new PlayerShip(initialPosition, boundaries, playerShots, enemyShots, livesLeft);


            this.invaders = new Invaders(boundaries, playerShots, enemyShots, random, display);
            invaders.MoveInvaders();

            this.display = new Display(boundaries);



            //Plays the music for the life force
            System.Media.SoundPlayer player = new System.Media.SoundPlayer();
            player.SoundLocation = @"C:\GameMusic\LifeForce.wav";
            player.Load();
            player.Play();



            this.initialScreen = DateTime.Now;
            this.initialImage  = (Bitmap)Properties.Resources.ResourceManager.GetObject("LifeForce1");
        }
Ejemplo n.º 3
0
        public void newWave()
        {
            this.invaders = new Invaders(boundaries, playerShots, enemyShots, random, display);

            wave += 1;
        }