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(); } }
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(); }