diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2020-06-01 22:24:41 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2020-06-01 22:24:41 +0200 |
commit | 842d1182857f7dd9ffc7f8bf6252100ae1199c06 (patch) | |
tree | 60b8922ccc405e1ace532f918153feb4baaceff0 /core/src/ch/asynk/gdx/boardgame/Piece.java | |
parent | 1a9d984f25b07a5c45484825274c177ea39bc1c3 (diff) | |
download | gdx-boardgame-842d1182857f7dd9ffc7f8bf6252100ae1199c06.zip gdx-boardgame-842d1182857f7dd9ffc7f8bf6252100ae1199c06.tar.gz |
Tile : float x,y->cx,cy, add int x,y
Diffstat (limited to 'core/src/ch/asynk/gdx/boardgame/Piece.java')
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/Piece.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/Piece.java b/core/src/ch/asynk/gdx/boardgame/Piece.java index 6d2bf52..b08970c 100644 --- a/core/src/ch/asynk/gdx/boardgame/Piece.java +++ b/core/src/ch/asynk/gdx/boardgame/Piece.java @@ -36,7 +36,7 @@ public class Piece implements Drawable, Positionable, Rotable, Scalable public void getPosOn(Tile tile, Orientation orientation, Vector3 v) { - v.set((tile.x - (getWidth() / 2f)), (tile.y - (getHeight() / 2f)), orientation.r()); + v.set((tile.cx - (getWidth() / 2f)), (tile.cy - (getHeight() / 2f)), orientation.r()); } public void setPosition(float x, float y, float r) @@ -55,8 +55,8 @@ public class Piece implements Drawable, Positionable, Rotable, Scalable public boolean isOn(Tile tile) { return ( - (Math.abs(getX() - (tile.x - (getWidth() / 2f))) < 3) && - (Math.abs(getY() - (tile.y - (getHeight() / 2f))) < 3) + (Math.abs(getX() - (tile.cx - (getWidth() / 2f))) < 3) && + (Math.abs(getY() - (tile.cy - (getHeight() / 2f))) < 3) ); } |