summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-15 17:00:09 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-15 17:00:09 +0100
commit4b3c560ae4356eef1b805202d0f100e4e12dce7e (patch)
tree184403506e273f160a7bf674773655f0b052a653 /core/src/ch/asynk
parent7463f1416738fae157a4235deed3babea71751a5 (diff)
downloadRustAndDust-4b3c560ae4356eef1b805202d0f100e4e12dce7e.zip
RustAndDust-4b3c560ae4356eef1b805202d0f100e4e12dce7e.tar.gz
Ctrl: actionDone() -> if next state is DONE burn down AP end check for end of turn
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/tankontank/game/Ctrl.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Ctrl.java b/core/src/ch/asynk/tankontank/game/Ctrl.java
index cc6f801..f430846 100644
--- a/core/src/ch/asynk/tankontank/game/Ctrl.java
+++ b/core/src/ch/asynk/tankontank/game/Ctrl.java
@@ -151,14 +151,16 @@ public class Ctrl implements Disposable
{
StateType nextState = this.state.done();
- if (map.activatedPawns.size() > 0) {
- player.burnDownOneAp();
- hud.update();
+ if (nextState == StateType.DONE) {
+ if (map.activatedPawns.size() > 0) {
+ TankOnTank.debug("burn down 1AP");
+ player.burnDownOneAp();
+ hud.update();
+ }
+ if (player.apExhausted())
+ hud.notifyEndOfTurn();
}
- if (player.apExhausted())
- swicthPlayer();
-
if (nextState == StateType.DONE)
nextState = battle.getState(player);