Exemplo n.º 1
0
 private void startGame()
 {
     loopBackgroundMusic();
     timer.Enabled     = true;
     inputHandler      = activeGameInputHandler;
     preTimeLabel.Text = "Time:";
     resetTime();
     timer.Start();
 }
Exemplo n.º 2
0
 private void resetGame()
 {
     stopBackgroundMusic();
     timer.Stop();
     timer.Enabled     = false;
     inputHandler      = inactiveGameInputHandler;
     preTimeLabel.Text = "Press 'a' to start game";
     timeLabel.Text    = "";
     resetScore();
 }
Exemplo n.º 3
0
        private void endGame()
        {
            stopBackgroundMusic();
            ScoreWindow scoreWindow = new ScoreWindow(this, score);

            scoreWindow.ShowDialog();
            inputHandler      = inactiveGameInputHandler;
            preTimeLabel.Text = "Press 'a' to start game";
            timeLabel.Text    = "";
            resetScore();
        }
Exemplo n.º 4
0
 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();
 }