diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-11 00:45:38 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-11 00:45:38 +0100 |
commit | 9f7ff7e3a739c2b8a657bfc154bdd9a6d5cb3f0c (patch) | |
tree | 78cfaa8c1923402f0ab4e2e2fdb38829aba3bbc1 /core/src | |
parent | 85e93410715c219026a58d33885d099b216608ee (diff) | |
download | RustAndDust-9f7ff7e3a739c2b8a657bfc154bdd9a6d5cb3f0c.zip RustAndDust-9f7ff7e3a739c2b8a657bfc154bdd9a6d5cb3f0c.tar.gz |
Hud: first chekout reinforcement and unitDock, if not hide Dock
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Hud.java | 4 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/hud/PlayerInfo.java | 15 |
2 files changed, 11 insertions, 8 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Hud.java b/core/src/ch/asynk/tankontank/game/Hud.java index d6911fd..1661195 100644 --- a/core/src/ch/asynk/tankontank/game/Hud.java +++ b/core/src/ch/asynk/tankontank/game/Hud.java @@ -130,10 +130,10 @@ public class Hud implements Disposable { hit = null; - if (actionButtons.touchDown(x, y)) - hit = actionButtons; if (playerInfo.touchDown(x, y)) hit = playerInfo; + else if (actionButtons.touchDown(x, y)) + hit = actionButtons; else if (okCancel.hit(x, y)) hit = okCancel; else if (stats.hit(x, y)) diff --git a/core/src/ch/asynk/tankontank/game/hud/PlayerInfo.java b/core/src/ch/asynk/tankontank/game/hud/PlayerInfo.java index 6786d70..bb4ad93 100644 --- a/core/src/ch/asynk/tankontank/game/hud/PlayerInfo.java +++ b/core/src/ch/asynk/tankontank/game/hud/PlayerInfo.java @@ -131,14 +131,17 @@ public class PlayerInfo implements Disposable, Drawable { hit = null; - if (turns.hit(x,y)) - hit = turns; + if (reinforcement.hit(x, y)) + hit = reinforcement; else if (unitDock.hit(x, y)) hit = unitDock; - else if (reinforcement.hit(x, y)) - hit = reinforcement; - else - return false; + else { + hideUnitDock(); + if (turns.hit(x,y)) + hit = turns; + else + return false; + } return true; } |