Beispiel #1
0
 private void newGame() {
   game_grid.clear();
   installNewPiece();
   num_rows_deleted = 0;
   rows_deleted_label.setText("0");
   level_label.setText("1");
   score_label.setText("0");
   startGame();
 }
Beispiel #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();
 }