diff --git a/app/src/main/java/school_project/GameUI.java b/app/src/main/java/school_project/GameUI.java index b06f966..83589a7 100644 --- a/app/src/main/java/school_project/GameUI.java +++ b/app/src/main/java/school_project/GameUI.java @@ -43,6 +43,12 @@ public class GameUI extends Group{ piece_space.y += _piece.boundary_size.y; + System.out.println(p.getPosition()); + if(p.getPosition() != null){ + _piece.setLayoutX(grid.getLayoutX() + p.getPosition().y * (SEGMENT_SIZE+SPACE_SIZE)); + _piece.setLayoutY(grid.getLayoutY() + p.getPosition().x * (SEGMENT_SIZE+SPACE_SIZE)); + } + // Pieces Events _piece.setOnMouseClicked(event -> { if(event.getButton() == MouseButton.SECONDARY){