示例#1
0
        public Balls(int n, Color color, float Angle, BallStart ballStart)
        {
            //Point addBalls = new Point(ballStart.currentPosition.X + 15, ballStart.currentPosition.Y);
            //balls.Add(new Balls.Ball(addBalls, Color.Black, (float)GetAngle(ballStart.currentPosition, e.Location) / 57.4F));

            startingPoint = new Point(ballStart.currentPosition.X + Constants.BALL_LAUNCHER_SIZE, ballStart.currentPosition.Y + Constants.BALL_LAUNCHER_SIZE);

            this.Angle    = Angle;
            this.allBalls = new List <Ball>();
            this.color    = color;
            numBalls      = n;
            ballsLeft     = n;
        }
示例#2
0
        /// <summary>
        /// Method to generate new game
        /// </summary>
        private void GenerateNewGame()
        {
            Row.ResetGame();
            rows = new List <Row>();
            rows.Add(new Row());

            _balls.Terminate();

            ballStart = new Balls.BallStart();

            // Sets score to 0 and all multipliers to 1;
            NewGameStats();

            scoreMultiplierLabel.Text  = "";
            damageMultiplierLabel.Text = "";
            ballMultiplierLabel.Text   = "";
            scoreLabel.Text            = "Score: 0";
        }
示例#3
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();
        }