diff options
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/PawnImage.java | 2 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/gfx/animations/RunnableAnimation.java | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/PawnImage.java b/core/src/ch/asynk/tankontank/engine/PawnImage.java index ac4a071..4a16cd5 100644 --- a/core/src/ch/asynk/tankontank/engine/PawnImage.java +++ b/core/src/ch/asynk/tankontank/engine/PawnImage.java @@ -58,7 +58,7 @@ public class PawnImage extends Image implements Pawn seq.addAnimation(MoveToAnimation.get(this, path.pop(), MOVE_TIME)); } - seq.addAnimation(RunnableAnimation.get(new Runnable() { + seq.addAnimation(RunnableAnimation.get(this, new Runnable() { @Override public void run() { path.push(finalPos); diff --git a/core/src/ch/asynk/tankontank/engine/gfx/animations/RunnableAnimation.java b/core/src/ch/asynk/tankontank/engine/gfx/animations/RunnableAnimation.java index 41a08a7..24b1e4b 100644 --- a/core/src/ch/asynk/tankontank/engine/gfx/animations/RunnableAnimation.java +++ b/core/src/ch/asynk/tankontank/engine/gfx/animations/RunnableAnimation.java @@ -8,6 +8,7 @@ import ch.asynk.tankontank.engine.gfx.Animation; public class RunnableAnimation implements Animation, Pool.Poolable { private Runnable runnable; + private Pawn pawn; private boolean ran; private static final Pool<RunnableAnimation> runnableAnimationPool = new Pool<RunnableAnimation>() { @@ -17,10 +18,11 @@ public class RunnableAnimation implements Animation, Pool.Poolable } }; - public static RunnableAnimation get(Runnable runnable) + public static RunnableAnimation get(Pawn pawn, Runnable runnable) { RunnableAnimation a = runnableAnimationPool.obtain(); a.runnable = runnable; + a.pawn = pawn; return a; } @@ -39,7 +41,7 @@ public class RunnableAnimation implements Animation, Pool.Poolable @Override public Pawn getPawn() { - return null; + return pawn; } @Override |