summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/tankontank/engine/Pawn.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java
index 582fbfd..d49e83f 100644
--- a/core/src/ch/asynk/tankontank/engine/Pawn.java
+++ b/core/src/ch/asynk/tankontank/engine/Pawn.java
@@ -90,6 +90,27 @@ public abstract class Pawn extends Image implements Disposable
return seq;
}
+ public AnimationSequence getMoveAnimation(Vector<Vector3> path)
+ {
+ int s = path.size();
+ final Vector3 finalPos = path.get(s - 1);
+
+ AnimationSequence seq = AnimationSequence.get(s + 1);
+
+ for (Vector3 v : path) {
+ seq.addAnimation(MoveToAnimation.get(this, v, MOVE_TIME));
+ }
+
+ seq.addAnimation(RunnableAnimation.get(this, new Runnable() {
+ @Override
+ public void run() {
+ moves.push(finalPos);
+ }
+ }));
+
+ return seq;
+ }
+
public boolean hasOverlayEnabled()
{
return overlays.isEnabled();