diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-06 16:36:31 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-06 16:36:31 +0200 |
commit | b3c6581c4610ac57ad9b99411eb55c09e31f2eb2 (patch) | |
tree | 4cae8408369aa9ab6e60b59367a2201f39955ded /core | |
parent | 5fe38ab4da89b04baad8440ae0b26b3542f2e6cf (diff) | |
download | RustAndDust-b3c6581c4610ac57ad9b99411eb55c09e31f2eb2.zip RustAndDust-b3c6581c4610ac57ad9b99411eb55c09e31f2eb2.tar.gz |
Map: add rotatePawn(..), in it and movePawn(...), use RunnableAnimation() to notify animation end
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Map.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java index bcb8a07..31c4964 100644 --- a/core/src/ch/asynk/tankontank/game/Map.java +++ b/core/src/ch/asynk/tankontank/game/Map.java @@ -13,6 +13,7 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import ch.asynk.tankontank.engine.Pawn; import ch.asynk.tankontank.engine.Board; import ch.asynk.tankontank.engine.Orientation; +import ch.asynk.tankontank.engine.gfx.animations.RunnableAnimation; public abstract class Map extends Board { @@ -120,10 +121,25 @@ public abstract class Map extends Board { int s = getCoordinatePath(pawn, finalPath, o); if (s > 0) { - movePawn(pawn, finalPath); + movePawn(pawn, finalPath, RunnableAnimation.get(pawn, new Runnable() { + @Override + public void run() { + ctrl.animationDone(); + } + })); } } + public void rotatePawn(Pawn pawn, Orientation o) + { + rotatePawn(pawn, o, RunnableAnimation.get(pawn, new Runnable() { + @Override + public void run() { + ctrl.animationDone(); + } + })); + } + public void hidePossibles() { enablePossibleTargets(false); |