Exemple #1
0
 private void startGame() {
   timer.setDelay(INITIAL_DELAY);
   timer.setPaused(false);
   start_newgame_butt.setLabel("Start New Game");
   pause_resume_butt.setEnabled(true);
   pause_resume_butt.setLabel("Pause");
   pause_resume_butt.validate();
   sounds.playSoundtrack();
 }
Exemple #2
0
 private void gameOver() {
   System.out.println("Game Over!");
   timer.setPaused(true);
   pause_resume_butt.setEnabled(false);
   int score = Integer.parseInt(score_label.getText());
   int high_score =
       high_score_label.getText().length() > 0 ? Integer.parseInt(high_score_label.getText()) : 0;
   if (score > high_score) high_score_label.setText("" + score);
   sounds.playGameOverSound();
 }
Exemple #3
0
 private void resumeGame() {
   timer.setPaused(false);
   pause_resume_butt.setLabel("Pause");
   sounds.playSoundtrack();
 }
Exemple #4
0
 private void pauseGame() {
   timer.setPaused(true);
   pause_resume_butt.setLabel("Resume");
   sounds.stopSoundtrack();
 }