diff options
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Board.java | 3 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Pawn.java | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java index aa58bab..026dd71 100644 --- a/core/src/ch/asynk/tankontank/engine/Board.java +++ b/core/src/ch/asynk/tankontank/engine/Board.java @@ -522,8 +522,7 @@ public abstract class Board implements Disposable public Pawn setPawnAt(Pawn pawn, GridPoint2 coords, Orientation o) { - Vector2 pos = getPawnPosAt(pawn, coords, null); - pawn.setPosition(pos.x, pos.y, o.r()); + pawn.setOnTile(getTile(coords.x, coords.y), o); pushPawnAt(pawn, coords); return pawn; } diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java index f1626cc..35973fb 100644 --- a/core/src/ch/asynk/tankontank/engine/Pawn.java +++ b/core/src/ch/asynk/tankontank/engine/Pawn.java @@ -142,6 +142,13 @@ public abstract class Pawn implements Moveable, Disposable return pos; } + public void setOnTile(Tile tile, Orientation o) + { + float x = (tile.getX() - (image.getWidth() / 2f)); + float y = (tile.getY() - (image.getHeight() / 2f)); + setPosition(x, y, o.r()); + } + @Override public float getX() { |