deleting piece position when clicked to avoid fantom pieces #63
@ -58,6 +58,7 @@ public class GameUI extends Group{
|
|||||||
_piece.setOnMouseReleased(event -> {
|
_piece.setOnMouseReleased(event -> {
|
||||||
if(event.getButton() != MouseButton.PRIMARY)
|
if(event.getButton() != MouseButton.PRIMARY)
|
||||||
return;
|
return;
|
||||||
|
p.setPosition(null);
|
||||||
if(event.getSceneX() > grid.getLayoutX() && event.getSceneX() < grid.getLayoutX() + grid.boundary_size.x
|
if(event.getSceneX() > grid.getLayoutX() && event.getSceneX() < grid.getLayoutX() + grid.boundary_size.x
|
||||||
&& event.getSceneY() > grid.getLayoutY() && event.getSceneY() < grid.getLayoutY() + grid.boundary_size.y )
|
&& event.getSceneY() > grid.getLayoutY() && event.getSceneY() < grid.getLayoutY() + grid.boundary_size.y )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user