Example #1
0
        public Game(Random random, Rectangle formArea)
        {
            this.formArea = formArea;
            this.random = random;
            stars = new Stars(random, formArea);
            scoreLocation = new PointF((formArea.Left + 5.0F), (formArea.Top + 5.0F));
            livesLocation = new PointF((formArea.Right - 120.0F), (formArea.Top + 5.0F));
            waveLocation = new PointF((formArea.Left + 5.0F), (formArea.Top + 25.0F));
            playerShip = new PlayerShip(formArea,
                new Point((formArea.Width / 2), (formArea.Height - 50)));
            playerShots = new List<Shot>();
            invaderShots = new List<Shot>();
            invaders = new List<Invader>();

            nextWave();
        }
Example #2
0
        public Game(Random random, Rectangle formArea)
        {
            this.formArea = formArea;
            this.random   = random;
            stars         = new Stars(random, formArea);
            scoreLocation = new PointF((formArea.Left + 5.0F), (formArea.Top + 5.0F));
            livesLocation = new PointF((formArea.Right - 120.0F), (formArea.Top + 5.0F));
            waveLocation  = new PointF((formArea.Left + 5.0F), (formArea.Top + 25.0F));
            playerShip    = new PlayerShip(formArea,
                                           new Point((formArea.Width / 2), (formArea.Height - 50)));
            playerShots  = new List <Shot>();
            invaderShots = new List <Shot>();
            invaders     = new List <Invader>();


            nextWave();
        }
Example #3
0
        // ***************************************************************************************************
        /// <summary>
        /// Game class constructor - Creating the game board
        /// </summary>
        /// <param name="random"></param>
        /// <param name="formArea"></param>
        public Game(Random random, Rectangle formArea)
        {
            this.formArea = formArea;
            this.random   = random;
            stars         = new Stars(random, formArea);
            scoreLocation = new PointF((formArea.Left + 240.0F), (formArea.Top + 15.0F));
            livesLocation = new PointF((formArea.Right - 410.0F), (formArea.Top + 15.0F));
            waveLocation  = new PointF((formArea.Left + 145.0F), (formArea.Top + 15.0F));
            uiRect        = new RectangleF(formArea.Left, formArea.Top, formArea.Width, formArea.Height);
            playerShip    = new PlayerShip(formArea,
                                           new Point((formArea.Width / 2), (formArea.Height - 50)));
            playerShots  = new List <Shot>();
            invaderShots = new List <Shot>();
            bossShots    = new List <Shot>();
            invaders     = new List <Invader>();
            boss         = new Alien(new Point(120, 50), 10);
            ui           = Properties.Resources.GameUI;
            //gameOverGraphic = Properties.Resources.GameOver;


            nextWave();
        }