feat: add line completed sound

This commit is contained in:
Martin Prokoph
2025-06-29 15:06:01 +02:00
parent 0a2294cd3d
commit f226cb40e2
8 changed files with 5 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
package eu.midnightdust.yaytris.game;
import eu.midnightdust.yaytris.Tetris;
import eu.midnightdust.yaytris.util.SoundEffect;
import java.awt.Color;
import java.util.*;
@@ -76,6 +77,7 @@ public class Space {
combo *= completedLines.size();
}
}
if (!completedLines.isEmpty()) SoundEffect.LINE_COMPLETED.play();
for (int completedIndex = 0; completedIndex < completedLines.size(); completedIndex++) { // Remove completed lines
int line = completedLines.toArray(new Integer[0])[completedIndex];
for (int i = line; i >= 0; i--) {