diff options
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-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; } |