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