From 9f7ff7e3a739c2b8a657bfc154bdd9a6d5cb3f0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 11 Nov 2014 00:45:38 +0100 Subject: Hud: first chekout reinforcement and unitDock, if not hide Dock --- core/src/ch/asynk/tankontank/game/Hud.java | 4 ++-- 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; } -- cgit v1.1-2-g2b99