Exemplo n.º 1
0
 /// <summary>
 /// Launching a new game.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void buttonPlayAgain_Click(object sender, EventArgs e)
 {
     // creating new formSimulatorWindow to play again
     formSimulatorWindow = new FormSimulatorWindow();
     // hiding formEndGame
     this.Hide();
     // showing formSimulatorWindow
     formSimulatorWindow.ShowDialog();
     // closing formEndGame
     this.Close();
 }
Exemplo n.º 2
0
 /// <summary>
 /// Starting game - opening new window with game
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void buttonStartGame_Click(object sender, EventArgs e)
 {
     // variable with player name
     yourName = textBoxYourName.Text;
     // creating formSimulatorWindow
     formSimulatorWindow = new FormSimulatorWindow();
     // displaying welcome text
     formSimulatorWindow.textToDisplay = "Welcome " + yourName + "! Enjoy your game!";
     // hiding main window
     this.Hide();
     // showing formSimulatorWindow
     formSimulatorWindow.ShowDialog();
     // closing main window
     this.Close();
 }