예제 #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();
 }
예제 #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();
 }
예제 #3
0
 private void resumeGame() {
   timer.setPaused(false);
   pause_resume_butt.setLabel("Pause");
   sounds.playSoundtrack();
 }
예제 #4
0
 private void pauseGame() {
   timer.setPaused(true);
   pause_resume_butt.setLabel("Resume");
   sounds.stopSoundtrack();
 }