summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-10 13:55:02 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-10 13:55:02 +0200
commit7cfa09595c02666ca36db9d07a572d0519d75b5a (patch)
treee21fe7587d7fe6aa469475bd2508d02845369d54 /core
parent12aecf2870f7994e9c62965a823a141bfa0c5dae (diff)
downloadRustAndDust-7cfa09595c02666ca36db9d07a572d0519d75b5a.zip
RustAndDust-7cfa09595c02666ca36db9d07a572d0519d75b5a.tar.gz
Hud: buttons rely on visible for hit, implement checkBtn
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/tankontank/game/Hud.java25
1 files changed, 12 insertions, 13 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Hud.java b/core/src/ch/asynk/tankontank/game/Hud.java
index 2c67f61..1639f3f 100644
--- a/core/src/ch/asynk/tankontank/game/Hud.java
+++ b/core/src/ch/asynk/tankontank/game/Hud.java
@@ -239,16 +239,13 @@ public class Hud implements Disposable
btn = null;
- if (!ctrl.isInAction()) {
- if (moveBtn.hit(x, y))
- btn = moveBtn;
- else if (rotateBtn.hit(x, y))
- btn = rotateBtn;
- else if (attackBtn.hit(x, y))
- btn = attackBtn;
- }
-
- if (checkBtn.hit(x, y))
+ if (moveBtn.hit(x, y))
+ btn = moveBtn;
+ else if (rotateBtn.hit(x, y))
+ btn = rotateBtn;
+ else if (attackBtn.hit(x, y))
+ btn = attackBtn;
+ else if (checkBtn.hit(x, y))
btn = checkBtn;
else if (cancelBtn.hit(x, y))
btn = cancelBtn;
@@ -271,9 +268,11 @@ public class Hud implements Disposable
ctrl.setState(GameState.State.MOVE);
else if (btn == rotateBtn)
ctrl.setState(GameState.State.ROTATE);
- // else if (btn == attackBtn)
- // ctrl.setState(GameState.State.ATTACK);
- // else if (btn == checkBtn)
+ else if (btn == attackBtn)
+ // TODO ctrl.setState(GameState.State.ATTACK);
+ System.out.println(" ATTACK not implemented yet");
+ else if (btn == checkBtn)
+ ctrl.done();
else if (btn == cancelBtn)
ctrl.abort();