summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/tankontank/engine/gfx/animations/MoveToAnimation.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/gfx/animations/MoveToAnimation.java b/core/src/ch/asynk/tankontank/engine/gfx/animations/MoveToAnimation.java
index 3e15261..ac09367 100644
--- a/core/src/ch/asynk/tankontank/engine/gfx/animations/MoveToAnimation.java
+++ b/core/src/ch/asynk/tankontank/engine/gfx/animations/MoveToAnimation.java
@@ -92,7 +92,7 @@ public class MoveToAnimation extends TimedAnimation
protected void end()
{
if (cb != null)
- cb.moveToAnimationDone(moveable, toX, toY, toR);
+ cb.moveToAnimationDone(moveable, (toX + (moveable.getWidth() / 2)), (toY + (moveable.getHeight() / 2)), toR);
dispose();
}
@@ -100,8 +100,10 @@ public class MoveToAnimation extends TimedAnimation
protected void update(float percent)
{
if ((cb != null) && !notified && (percent >= 0.5)) {
- cb.moveToAnimationLeave(moveable, fromX, fromY, fromR);
- cb.moveToAnimationEnter(moveable, toX, toY, toR);
+ float dw = (moveable.getWidth() / 2);
+ float dh = (moveable.getHeight() / 2);
+ cb.moveToAnimationLeave(moveable, (fromX + dw), (fromY + dh), fromR);
+ cb.moveToAnimationEnter(moveable, (toX + dw), (toY + dh), toR);
notified = true;
}
if (percent == 1f)