feat: add difficulty setting
This commit is contained in:
@@ -9,10 +9,12 @@ public class Space {
|
||||
private final Color[][] gameMap; // Bereits abgesetzte Tetrominos werden nur noch als einzelne Farben ('Blobs') auf der Karte abgespeichert
|
||||
private TetrominoShape nextShape;
|
||||
private Tetromino currentTetromino;
|
||||
private int score;
|
||||
|
||||
public Space() {
|
||||
gameMap = new Color[12][7];
|
||||
nextShape = getNextShape();
|
||||
score = 0;
|
||||
|
||||
Tetromino mino = new Tetromino(TetrominoShape.T);
|
||||
mino.move(-2);
|
||||
@@ -62,7 +64,7 @@ public class Space {
|
||||
return gameMap;
|
||||
}
|
||||
|
||||
public int onLinesChanged(Tetromino tetromino, int... lines) {
|
||||
public void onLinesChanged(Tetromino tetromino, int... lines) {
|
||||
int combo = 0;
|
||||
Set<Integer> completedLines = new TreeSet<>();
|
||||
for (int line : lines) {
|
||||
@@ -85,7 +87,8 @@ public class Space {
|
||||
gameMap[i] = (i-1 < 0) ? new Color[gameMap[i].length] : gameMap[i-1];
|
||||
}
|
||||
}
|
||||
return combo;
|
||||
this.score += combo;
|
||||
//System.out.println(score);
|
||||
}
|
||||
|
||||
public Tetromino getCurrentTetromino() {
|
||||
|
||||
Reference in New Issue
Block a user