summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/game
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-15 17:38:06 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-15 17:38:06 +0100
commit2867d71c854a69afdded2c53dd95879d8bdcbee7 (patch)
treedbb8d1d188fce16c743215950206dd9f5f9d73db /core/src/ch/asynk/tankontank/game
parentf90d63c3c686fd36bab40a30d856c7b003f06bb8 (diff)
downloadRustAndDust-2867d71c854a69afdded2c53dd95879d8bdcbee7.zip
RustAndDust-2867d71c854a69afdded2c53dd95879d8bdcbee7.tar.gz
StateBreak: clean up
Diffstat (limited to 'core/src/ch/asynk/tankontank/game')
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateBreak.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/core/src/ch/asynk/tankontank/game/states/StateBreak.java b/core/src/ch/asynk/tankontank/game/states/StateBreak.java
index a64a494..479f5ae 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateBreak.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateBreak.java
@@ -8,15 +8,14 @@ import ch.asynk.tankontank.TankOnTank;
public class StateBreak extends StateCommon
{
- private boolean done;
private Orientation o = Orientation.KEEP;
@Override
public void enter(StateType prevState)
{
- done = false;
activeUnit = null;
ctrl.hud.actionButtons.show(Buttons.DONE.b);
+ ctrl.hud.pushNotify("Break move possible");
map.showBreakPawns();
}
@@ -39,7 +38,6 @@ public class StateBreak extends StateCommon
@Override
public StateType done()
{
- doRotation(o);
return StateType.DONE;
}
@@ -69,22 +67,23 @@ public class StateBreak extends StateCommon
map.hideDirections(to);
map.showOrientation(to, o);
ctrl.hud.actionButtons.show(Buttons.DONE.b);
- } else
+ } else {
doRotation(o);
+ ctrl.setState(StateType.ANIMATION);
+ }
}
}
private void doRotation(Orientation o)
{
- if (done || (activeUnit == null)) return;
- done = true;
+ if (activeUnit == null) return;
map.possiblePaths.init(activeUnit);
if (map.possiblePaths.build(to) == 1) {
map.possiblePaths.orientation = o;
map.movePawn(activeUnit, o);
ctrl.setAnimationCount(1);
- ctrl.setState(StateType.ANIMATION);
+ ctrl.setAfterAnimationState(StateType.DONE);
} else
TankOnTank.debug("That's very wrong there should be only one path");
}