stop piece screen overflow
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
Debucquoy Anthony 2023-05-17 19:21:26 +02:00
parent 3d4730cfc0
commit b4ece0812e
Signed by: tonitch
GPG Key ID: A78D6421F083D42E

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){