summaryrefslogtreecommitdiffstats
path: root/core/src/ch
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-06 16:32:39 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-06 16:32:39 +0200
commite77270a7412351bdf61398b10e4a6386ad19ca8a (patch)
tree05ed735b054fcd438d839efbfdb8a17f37d63fcb /core/src/ch
parentad6e417ec0186ae827d662cd454f575c5d045b27 (diff)
downloadRustAndDust-e77270a7412351bdf61398b10e4a6386ad19ca8a.zip
RustAndDust-e77270a7412351bdf61398b10e4a6386ad19ca8a.tar.gz
Hud: add reset()
Diffstat (limited to 'core/src/ch')
-rw-r--r--core/src/ch/asynk/tankontank/game/Hud.java13
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;