feat: preview of next shape
This commit is contained in:
@@ -16,23 +16,27 @@ public class Space {
|
||||
|
||||
public Space() {
|
||||
gameMap = new Color[14][8];
|
||||
nextShape = getNextShape();
|
||||
nextShape = generateNextShape();
|
||||
score = 0;
|
||||
}
|
||||
|
||||
public void spawnTetromino() {
|
||||
currentTetromino = new Tetromino(nextShape);
|
||||
nextShape = getNextShape();
|
||||
nextShape = generateNextShape();
|
||||
}
|
||||
|
||||
public Tetromino getCurrentTetromino() {
|
||||
return currentTetromino;
|
||||
}
|
||||
|
||||
public TetrominoShape getNextShape() {
|
||||
public TetrominoShape generateNextShape() {
|
||||
return TetrominoShape.values()[random.nextInt(TetrominoShape.values().length)];
|
||||
}
|
||||
|
||||
public TetrominoShape getNextShape() {
|
||||
return nextShape;
|
||||
}
|
||||
|
||||
public int getMapWidth() {
|
||||
return gameMap[0].length;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user