diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-04 15:27:13 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-04 15:27:13 +0100 |
commit | 98debdd8c072db07f906b1d3c80de9aa8e6bc644 (patch) | |
tree | 1b8ac24493691214533ac799614c699759bc18ee /core/src/ch | |
parent | 72831aae700ef45c48e16b58bbee50854b5ad508 (diff) | |
download | RustAndDust-98debdd8c072db07f906b1d3c80de9aa8e6bc644.zip RustAndDust-98debdd8c072db07f906b1d3c80de9aa8e6bc644.tar.gz |
Hud: fix touchUp button, do not set it On before checking for hit
Diffstat (limited to 'core/src/ch')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Hud.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Hud.java b/core/src/ch/asynk/tankontank/game/Hud.java index de58c91..1f7d591 100644 --- a/core/src/ch/asynk/tankontank/game/Hud.java +++ b/core/src/ch/asynk/tankontank/game/Hud.java @@ -238,7 +238,7 @@ public class Hud implements Disposable public boolean touchUp(float x, float y) { if (btn != null) { - btn.setOn(); + boolean setOn = true; if (actionsBg.hit(x, y)) { if ((btn == moveBtn) && moveBtn.hit(x, y)) ctrl.setState(State.StateType.MOVE); @@ -254,9 +254,11 @@ public class Hud implements Disposable notify("Action canceled"); ctrl.abort(); } else - btn.setOff(); + setOn = false; } else - btn.setOff(); + setOn = false; + if (setOn) btn.setOn(); + else btn.setOff(); btn = null; } else if (turns.hit(x, y)) { |