stop piece screen overflow #62
@ -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){
|
||||
|
Loading…
Reference in New Issue
Block a user