Beispiel #1
0
 public FactoryFood(ProgressBar progress, ProgressBarChanges progressChange)
 {
     _normalFood       = new NormalFood(10, 5, Brushes.Red);
     _timerFood        = new TimerFood(10, 5, Brushes.DarkBlue);
     this._progress    = progress;
     progressBarChange = progressChange;
 }
Beispiel #2
0
        void InitializeObjects()
        {
            labGameOver.Visible = false;
            labScore.Text       = Score.ToString();

            MessageBox.Show("Game will begin after you close this window", "Good luck!");

            snake       = new Snake(new Circle(2, 10, Brushes.Black));
            progress    = new ProgressBarChanges(progressTime, labProgress);
            factoryFood = new FactoryFood(progressTime, progress);
            newFood     = new NormalFood(10, 5, Brushes.Red);

            progress.SetProgressBarOff();

            // START OF THE TIMER
            GameTimer.Tick    += UpdateScreen;
            GameTimer.Interval = 100;
            GameTimer.Start();
        }