Beispiel #1
0
 private void startButton_Click(object sender, EventArgs e)
 {
     if (_gameForm == null)
     {
         // if there isn't a game yet, create a new one
         _gameForm = new Game();
         // set the close method to gameClosed
         _gameForm.FormClosed += gameClosed;
     }
     audio.Play();
     // show the game and hide main menu (this)
     _gameForm.Show();
     Hide();
 }
 /// <summary>
 /// Reset en creëert een nieuwe game.
 /// </summary>
 void CreateGame()
 {
     Base.currentGame = null;
     currentGame = null;
     Base.currentGame = new Game(player1Vehicle, player2Vehicle);
     Progressbars.TotalLaps = TotalLaps;
     currentGame = Base.currentGame;
 }