private void SubButt_Click(object sender, EventArgs e) { music.PlayLoop(TICTACTOE); P1Lab.Hide(); P2Lab.Hide(); WriteNameLabel.Hide(); P1TX.Hide(); P2TX.Hide(); SubButt.Hide(); p1name = P1TX.Text; p2name = P2TX.Text; if (p1name.Length == 0 || p1name == null) { p1name = "Player 1"; P1NameLab.Text += p1name + ":"; } else { P1NameLab.Text += p1name + ":"; } if (p2name.Length == 0 || p2name == null) { p2name = "Player 2"; P2NameLab.Text += p2name + ":"; } else { P2NameLab.Text += p2name + ":"; } StartGame(); }
private void NewGameClick(object sender, EventArgs e) { gameMth.reset(); DisableButtons(); P1TX.Clear(); P2TX.Clear(); P1NameLab.Text = "X -"; P2NameLab.Text = "O -"; P1ScoreLab.Text = ""; P2ScoreLab.Text = ""; P1Lab.Show(); P2Lab.Show(); WriteNameLabel.Show(); P1TX.Show(); P2TX.Show(); SubButt.Show(); p1point = 0; p2point = 0; }