Esempio n. 1
0
 private void startGame_Click(object sender, EventArgs e)
 {
     if (game != null)
     {
         if (game.isFinished == true)
         {
             _interceptor.StopCapturing();
             _interceptor.StartCapturing();
             highestLevelLabel.Text = "Your highest level is: " + game.currentLevel.ToString();
             game.destroy();
             game = new Game(selectedColor);
             game.start();
         }
         else
         {
             highestLevelLabel.Text = "Your highest level is: " + game.currentLevel.ToString();
             game.destroy();
             _interceptor.StopCapturing();
             _interceptor.StartCapturing();
             game.start();
         }
     } else
     {
         _interceptor.StopCapturing();
         _interceptor.StartCapturing();
         game = new Game(selectedColor);
         game.start();
     }
 }
Esempio n. 2
0
 private void restartGame_Click(object sender, EventArgs e)
 {
     highestLevelLabel.Text = "Your highest level is: " + game.currentLevel.ToString();
     game.destroy();
     _interceptor.StopCapturing();
     _interceptor.StartCapturing();
     game = new Game(selectedColor);
     game.start();
 }