Exemple #1
0
 //this button allows the user to start the game as a client who is connecting to another players game
 private void StartClient_Click(object sender, EventArgs e)
 {
     //make sure the user has entered
     if (ipAddressBox.Text == "")
     {
         MessageBox.Show("You need to enter an IP address in order to connect.");
         return;
     }
     //start the game in a new form
     sg = new SalvoGame("Client", ipAddressBox.Text);
     sg.Show();
 }
Exemple #2
0
 //this button allows the user to start the game as a host who is waiting for another player to connect
 private void StartHost_Click(object sender, EventArgs e)
 {
     //start the game in a new form
     sg = new SalvoGame("Host", "");
     sg.Show();
 }