Example #1
0
  private void removeFullRows() {
    int n_full = countFullRows();
    score_label.addValue((int) (10 * Math.pow(2, n_full) - 10));
    if (n_full == 0) return;

    sounds.playDestroyRows(n_full);

    if (num_rows_deleted / DELETED_ROWS_PER_LEVEL
        != (num_rows_deleted + n_full) / DELETED_ROWS_PER_LEVEL) {
      timer.faster();
      level_label.addValue(n_full / DELETED_ROWS_PER_LEVEL + 1);
      level_label.repaint();
    }

    rows_deleted_label.addValue(n_full);
    num_rows_deleted += n_full;

    for (int i = ROWS - 1; i >= 0; i--) while (rowIsFull(i)) removeRow(i);

    game_grid.repaint();
  }