public void GameWin() { gameTimer.Enabled = false; //outputLabel.Visible = false; gameOverLabel.Visible = true; gameOverLabel.Text = "You Win! Returning to main menu"; gameOverLabel.Refresh(); Thread.Sleep(2000); Form f = this.FindForm(); f.Controls.Remove(this); MainScreen ms = new MainScreen(); f.Controls.Add(ms); }
public void GameOver() { gameTimer.Enabled = false; lose.Play(); gameOverLabel.Visible = true; gameOverLabel.Text = "Game over, returning to main menu."; gameOverLabel.Refresh(); Thread.Sleep(3000); Form f = this.FindForm(); f.Controls.Remove(this); MainScreen ms = new MainScreen(); f.Controls.Add(ms); }
public void Pause() { if (gameTimer.Enabled == true) { gameTimer.Enabled = false; DialogResult dr = PauseForm.Show(); if (dr == DialogResult.Cancel) { gameTimer.Enabled = true; } else if (dr == DialogResult.Abort) { Form form = this.FindForm(); MainScreen ms = new MainScreen(); form.Controls.Add(ms); form.Controls.Remove(this); } } }