30 lines
816 B
Java
30 lines
816 B
Java
|
package school_project;
|
||
|
|
||
|
import javafx.geometry.Pos;
|
||
|
import javafx.scene.layout.BorderPane;
|
||
|
import javafx.scene.layout.HBox;
|
||
|
import javafx.scene.paint.Color;
|
||
|
import school_project.Utils.MatrixShape;
|
||
|
|
||
|
public class GameUI extends BorderPane {
|
||
|
public final static int SEGMENT_SIZE = 50;
|
||
|
public GameUI(Map level) {
|
||
|
super();
|
||
|
|
||
|
MatrixShape grid = new MatrixShape(level);
|
||
|
grid.setAlignment(Pos.CENTER);
|
||
|
grid.setColor(Color.WHITE);
|
||
|
|
||
|
HBox pieces = new HBox();
|
||
|
pieces.setSpacing(10);
|
||
|
for (Piece p : level.getPieces()) {
|
||
|
MatrixShape _piece = new MatrixShape(p);
|
||
|
_piece.setColor(Color.RED); // TODO: Change with piece color
|
||
|
pieces.getChildren().add(_piece);
|
||
|
}
|
||
|
|
||
|
setCenter(grid);
|
||
|
setBottom(pieces);
|
||
|
}
|
||
|
}
|