private void startGame() { loopBackgroundMusic(); timer.Enabled = true; inputHandler = activeGameInputHandler; preTimeLabel.Text = "Time:"; resetTime(); timer.Start(); }
private void resetGame() { stopBackgroundMusic(); timer.Stop(); timer.Enabled = false; inputHandler = inactiveGameInputHandler; preTimeLabel.Text = "Press 'a' to start game"; timeLabel.Text = ""; resetScore(); }
private void endGame() { stopBackgroundMusic(); ScoreWindow scoreWindow = new ScoreWindow(this, score); scoreWindow.ShowDialog(); inputHandler = inactiveGameInputHandler; preTimeLabel.Text = "Press 'a' to start game"; timeLabel.Text = ""; resetScore(); }
private void timer_Tick(object sender, EventArgs e) { if (time <= 0) { timer.Stop(); timer.Enabled = false; endGame(); inputHandler = null; inputHandler = inactiveGameInputHandler; return; } this.time -= 1d; displayTime(); }