diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-06 16:32:39 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-06 16:32:39 +0200 |
commit | e77270a7412351bdf61398b10e4a6386ad19ca8a (patch) | |
tree | 05ed735b054fcd438d839efbfdb8a17f37d63fcb | |
parent | ad6e417ec0186ae827d662cd454f575c5d045b27 (diff) | |
download | RustAndDust-e77270a7412351bdf61398b10e4a6386ad19ca8a.zip RustAndDust-e77270a7412351bdf61398b10e4a6386ad19ca8a.tar.gz |
Hud: add reset()
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Hud.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Hud.java b/core/src/ch/asynk/tankontank/game/Hud.java index 9918f68..189af06 100644 --- a/core/src/ch/asynk/tankontank/game/Hud.java +++ b/core/src/ch/asynk/tankontank/game/Hud.java @@ -137,6 +137,14 @@ public class Hud implements Disposable cancelAct.getImage().draw(batch); } + public void reset() + { + moveAct.setOff(); + rotateAct.setOff(); + attackAct.setOff(); + cancelAct.setOff(); + } + public boolean touchDown(float x, float y) { if (!rect.contains(x,y)) return false; @@ -163,11 +171,8 @@ public class Hud implements Disposable attackAct.setOn(); ctrl.setState(GameState.State.ATTACK, false); } else if (cancelAct.hit(x, y)) { + reset(); ctrl.abort(); - moveAct.setOff(); - rotateAct.setOff(); - attackAct.setOff(); - cancelAct.toggle(); } return true; |