summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-16 01:50:54 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-16 01:50:54 +0100
commita71999d9a42a589ca767ad2c8fb7afbbd5eb9207 (patch)
tree71ce51e6b0db794f2045bc947b73e1a6d74c6609 /core/src/ch/asynk
parent375b1da1637c9eaf2c84d4cdc6db5670567fed33 (diff)
downloadRustAndDust-a71999d9a42a589ca767ad2c8fb7afbbd5eb9207.zip
RustAndDust-a71999d9a42a589ca767ad2c8fb7afbbd5eb9207.tar.gz
Hud: if okCancel or stats are visible only them can hit
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/tankontank/game/Hud.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Hud.java b/core/src/ch/asynk/tankontank/game/Hud.java
index 8812061..09f2408 100644
--- a/core/src/ch/asynk/tankontank/game/Hud.java
+++ b/core/src/ch/asynk/tankontank/game/Hud.java
@@ -120,14 +120,17 @@ public class Hud implements Disposable
{
hit = null;
- if (actionButtons.touchDown(x, y))
+ if (okCancel.visible) {
+ if (okCancel.hit(x, y))
+ hit = okCancel;
+ } else if (stats.visible) {
+ if (stats.hit(x, y))
+ hit = stats;
+ }
+ else if (actionButtons.touchDown(x, y))
hit = actionButtons;
else if (playerInfo.touchDown(x, y))
hit = playerInfo;
- else if (okCancel.hit(x, y))
- hit = okCancel;
- else if (stats.hit(x, y))
- hit = stats;
return (hit != null);
}