diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-06 11:08:17 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-06 11:08:17 +0200 |
commit | a424d4d54d75ce53eb51932620df6f0931a2f9f0 (patch) | |
tree | 99f6cc9173dc40f51d3d3b6162b3f61d607529da | |
parent | e4724369211efe1017099300e8ac83faacb26c05 (diff) | |
download | RustAndDust-a424d4d54d75ce53eb51932620df6f0931a2f9f0.zip RustAndDust-a424d4d54d75ce53eb51932620df6f0931a2f9f0.tar.gz |
Pawn,Board: add a RunnableAnimation to notify the end of the animation
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Board.java | 3 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Pawn.java | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java index dddb746..ee0c76e 100644 --- a/core/src/ch/asynk/tankontank/engine/Board.java +++ b/core/src/ch/asynk/tankontank/engine/Board.java @@ -437,7 +437,7 @@ public abstract class Board implements Disposable pushPawnAt(pawn, coords); } - public void movePawn(final Pawn pawn, ArrayList<Vector3> path) + public void movePawn(final Pawn pawn, ArrayList<Vector3> path, RunnableAnimation whenDone) { removePawnFrom(pawn, getHexAt(pawn.getCenter())); @@ -448,6 +448,7 @@ public abstract class Board implements Disposable pushPawnAt(pawn, getHexAt(pawn.getCenter())); } })); + seq.addAnimation(whenDone); addPawnAnimation(pawn, seq); } diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java index 51ac492..f68c473 100644 --- a/core/src/ch/asynk/tankontank/engine/Pawn.java +++ b/core/src/ch/asynk/tankontank/engine/Pawn.java @@ -144,7 +144,7 @@ public abstract class Pawn implements Drawable, Disposable int s = path.size(); final Vector3 finalPos = path.get(s - 1); - AnimationSequence seq = AnimationSequence.get(s + 1); + AnimationSequence seq = AnimationSequence.get(s + 3); for (Vector3 v : path) { seq.addAnimation(MoveToAnimation.get(this, v, MOVE_TIME)); |