feat: expand space
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package eu.midnightdust.yaytris.game;
|
||||
|
||||
import eu.midnightdust.yaytris.Tetris;
|
||||
import eu.midnightdust.yaytris.ui.ScoreMenu;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.*;
|
||||
@@ -15,7 +14,7 @@ public class Space {
|
||||
private int score;
|
||||
|
||||
public Space() {
|
||||
gameMap = new Color[12][7];
|
||||
gameMap = new Color[14][8];
|
||||
nextShape = getNextShape();
|
||||
score = 0;
|
||||
}
|
||||
@@ -75,14 +74,12 @@ public class Space {
|
||||
}
|
||||
for (int completedIndex = 0; completedIndex < completedLines.size(); completedIndex++) { // Remove completed lines
|
||||
int line = completedLines.toArray(new Integer[0])[completedIndex];
|
||||
for (int i = line+completedIndex; i >= 0; i--) {
|
||||
if (i >= getMapHeight()) continue;
|
||||
for (int i = line; i >= 0; i--) {
|
||||
gameMap[i] = (i-1 < 0) ? new Color[gameMap[i].length] : gameMap[i-1];
|
||||
}
|
||||
}
|
||||
this.score += combo;
|
||||
if (Tetris.getUi().getMenuPanel() instanceof ScoreMenu) ((ScoreMenu)Tetris.getUi().getMenuPanel()).updateScore(this.score);
|
||||
//System.out.println(score);
|
||||
Tetris.updateScore(this.score);
|
||||
}
|
||||
|
||||
public Tetromino getCurrentTetromino() {
|
||||
|
||||
Reference in New Issue
Block a user