feat: add elapsed time, fix bugs

This commit is contained in:
Martin Prokoph
2025-06-29 18:24:02 +02:00
parent 39c290e22f
commit 7671bdec04
9 changed files with 54 additions and 15 deletions

View File

@@ -66,6 +66,10 @@ public class Space {
Set<Integer> completedLines = new TreeSet<>();
for (int line : lines) {
if (line >= getMapHeight()) continue;
if (line < 0) {
Tetris.stopGame();
return;
}
Color[] newBlobs = tetromino.getLine(line);
for (int i = 0; i < newBlobs.length; i++) {
if (newBlobs[i] == null) continue;
@@ -85,6 +89,7 @@ public class Space {
}
}
increaseScore(combo);
this.spawnTetromino();
}
public void increaseScore(int amount) {