stop piece screen overflow #62

Merged
tonitch merged 1 commits from screenOverflow into master 2023-05-17 22:38:01 +02:00

View File

@ -28,17 +28,17 @@ public class GameUI extends Group{
for (Piece p : level.getPieces()) {
MatrixShape _piece = new MatrixShape(p);
_piece.setLayoutX(piece_space.x);
_piece.setLayoutY(piece_space.y);
piece_space.y += _piece.boundary_size.y;
if(piece_space.y >= Controller.screen_size.y){
if(piece_space.y + _piece.boundary_size.y >= Controller.screen_size.y){
column++;
piece_space.y = SPACE_SIZE;
piece_space.x = (SEGMENT_SIZE*3 + SPACE_SIZE*4 )* column;
}
_piece.setLayoutX(piece_space.x);
_piece.setLayoutY(piece_space.y);
piece_space.y += _piece.boundary_size.y;
// Pieces Events
_piece.setOnMouseClicked(event -> {
if(event.getButton() == MouseButton.SECONDARY){