deleting piece position when clicked to avoid fantom pieces
This commit is contained in:
parent
3d4730cfc0
commit
1584fe539d
@ -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