diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-06 16:54:55 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-06 16:54:55 +0200 |
commit | 298ddb56e9cdb6c21eeaa4ceffa02381c883ee7c (patch) | |
tree | ad770f426cf452d003eca693007e163330a656c2 /core/src | |
parent | b3c6581c4610ac57ad9b99411eb55c09e31f2eb2 (diff) | |
download | RustAndDust-298ddb56e9cdb6c21eeaa4ceffa02381c883ee7c.zip RustAndDust-298ddb56e9cdb6c21eeaa4ceffa02381c883ee7c.tar.gz |
GameStateRotate: do not run animation if already heading in the right direction
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/states/GameStateRotate.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/src/ch/asynk/tankontank/game/states/GameStateRotate.java b/core/src/ch/asynk/tankontank/game/states/GameStateRotate.java index 2be7ee3..0a24b35 100644 --- a/core/src/ch/asynk/tankontank/game/states/GameStateRotate.java +++ b/core/src/ch/asynk/tankontank/game/states/GameStateRotate.java @@ -51,8 +51,12 @@ public class GameStateRotate extends GameStateCommon if (o != Orientation.KEEP) { clear(); - map.rotatePawn(pawn, o); - ctrl.setState(State.ANIMATION); + if (pawn.getOrientation() != o) { + map.rotatePawn(pawn, o); + ctrl.setState(State.ANIMATION); + } else { + ctrl.animationDone(); + } } } |