private void btnPlay_Click(object sender, EventArgs e) { frmPlayConundrum play = new frmPlayConundrum(playerName); play.Show(); this.Hide(); }
private void timer1_Tick(object sender, EventArgs e) { time = time - 1; lblTime.Text = time.ToString(); if (time <= 10) { lblTime.ForeColor = System.Drawing.Color.Red; } if (time == 0) { timer1.Enabled = false; MessageBox.Show("You have run out of time", "Game Over"); var playerChoice = MessageBox.Show("Congratulations " + playerName + " you scored " + score + "\nWould you like to play again?", "Game Over", MessageBoxButtons.YesNo); if (playerChoice == DialogResult.Yes) { frmPlayConundrum pCon = new frmPlayConundrum(playerName); pCon.Show(); this.Hide(); } else { frmGameChoice gameC = new frmGameChoice(playerName); gameC.Show(); this.Hide(); } } }