diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Pawn.java | 11 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Map.java | 4 |
2 files changed, 9 insertions, 6 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java index ba4a2bd..531b337 100644 --- a/core/src/ch/asynk/tankontank/engine/Pawn.java +++ b/core/src/ch/asynk/tankontank/engine/Pawn.java @@ -224,11 +224,14 @@ public abstract class Pawn implements Moveable, Disposable setPosition(position.x, position.y, position.z); } - public Vector2 getCenter() + public float getCenterX() { - float x = (getX() + (getWidth() / 2f)); - float y = (getY() + (getHeight() / 2f)); - return new Vector2(x, y); + return (getX() + (getWidth() / 2f)); + } + + public float getCenterY() + { + return (getY() + (getHeight() / 2f)); } public Vector2 getPosAt(Tile tile, Vector2 pos) diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java index 9ea8685..cb594f7 100644 --- a/core/src/ch/asynk/tankontank/game/Map.java +++ b/core/src/ch/asynk/tankontank/game/Map.java @@ -314,11 +314,11 @@ public abstract class Map extends Board AnimationSequence seq = AnimationSequence.get(2); if (success) { - explosions.init(1, target.getCenter().x, target.getCenter().y); + explosions.init(1, target.getCenterX(), target.getCenterY()); seq.addAnimation(explosions); seq.addAnimation(notifyDoneAnimation(unit)); } else { - explosion.init(1, target.getCenter().x, target.getCenter().y); + explosion.init(1, target.getCenterX(), target.getCenterY()); seq.addAnimation(explosion); seq.addAnimation(RunnableAnimation.get(unit, new Runnable() { @Override |