feat: expand space

This commit is contained in:
Martin Prokoph
2025-06-29 09:46:00 +02:00
parent 4c0f8d1c02
commit 082ff42208
3 changed files with 12 additions and 9 deletions

View File

@@ -36,6 +36,8 @@ public class Tetris {
}
public static void resetSpace() {
if (gravityTask != null) gravityTask.cancel();
timer.purge();
space = new Space();
}
@@ -54,9 +56,13 @@ public class Tetris {
}
public static void stopGame() {
gravityTask.cancel();
if (gravityTask != null) gravityTask.cancel();
timer.purge();
if (ui.getMenuPanel() instanceof ScoreMenu) ((ScoreMenu) Tetris.ui.getMenuPanel()).gameOver();
if (ui.getMenuPanel() instanceof ScoreMenu) ((ScoreMenu) ui.getMenuPanel()).gameOver();
ui.transferFocus();
}
public static void updateScore(int score) {
if (ui.getMenuPanel() instanceof ScoreMenu) ((ScoreMenu) ui.getMenuPanel()).updateScore(score);
}
}