Esempio n. 1
0
        /// <summary>
        /// Method to initialize all the member variabless
        /// </summary>
        private void InitGame()
        {
            timerDraw.Enabled  = true;
            timerDraw.Interval = Constants.TIMER_60_FPS;
            OpenPreviousGame();
            this.DoubleBuffered  = true;
            this.KeyPreview      = true;
            this.FormBorderStyle = FormBorderStyle.FixedSingle;
            this.MaximizeBox     = false;
            this.ballsDraw       = new Timer();
            ballsDraw.Interval   = 28;
            ballsDraw.Tick      += new EventHandler(timerDraw_Tick);
            ballsDraw.Start();
            hitSoundPlayer          = new SoundPlayer(Properties.Resources.hitSound);
            powerUpSoundPlayer      = new SoundPlayer(Properties.Resources.powerUpSound);
            Constants.WINDOW_HEIGHT = this.Height;
            Constants.WINDOW_WIDTH  = this.Width;

            ballBrush = new SolidBrush(Color.White);
            ballStart = new Balls.BallStart();
            _balls    = new Balls.Balls(0, Color.Black, 0, ballStart);

            // Sets score to 0 and all other multipliers to 1.

            /*
             *      NewGameStats();
             *
             *      powerups = new List<int>();
             *
             *      scoreMultiplierLabel.Text = "";
             *      damageMultiplierLabel.Text = "";
             *      ballMultiplierLabel.Text = "";
             *      scoreLabel.Text = "Score: 0";
             */

            konami = new KonamiSequence();
        }
Esempio n. 2
0
 /// <summary>
 /// Method to throw the balls at given location
 /// </summary>
 /// <param name="location">Final location where the balls should be thrown at</param>
 private void ThrowBalls(Point location)
 {
     _balls = new Balls.Balls(ballsToAdd * Game.ballMultiplier, Color.Black, GetAngle(ballStart.currentPosition, location), ballStart);
     Game.ballMultiplier = 1;
 }