summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/game
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-12 16:19:27 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-12 16:19:27 +0100
commit0457ab6e2494d3e4c9574a6df2c861e6804f3746 (patch)
treed8453e4da4d1406c3d07f01c29dbd8c4de69dcd3 /core/src/ch/asynk/tankontank/game
parent42d10589c59291a9be7a685929081515156c6505 (diff)
downloadRustAndDust-0457ab6e2494d3e4c9574a6df2c861e6804f3746.zip
RustAndDust-0457ab6e2494d3e4c9574a6df2c861e6804f3746.tar.gz
GameScreen,Ctrl: send hud and map coordinates to Ctrl.touchUp/Down
Diffstat (limited to 'core/src/ch/asynk/tankontank/game')
-rw-r--r--core/src/ch/asynk/tankontank/game/Ctrl.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Ctrl.java b/core/src/ch/asynk/tankontank/game/Ctrl.java
index c42de49..a3d1855 100644
--- a/core/src/ch/asynk/tankontank/game/Ctrl.java
+++ b/core/src/ch/asynk/tankontank/game/Ctrl.java
@@ -26,6 +26,7 @@ public class Ctrl implements Disposable
public Player player;
public Player opponent;
public boolean blockMap;
+ public boolean blockHud;
private State selectState;
private State pathState;
@@ -67,6 +68,7 @@ public class Ctrl implements Disposable
this.hud = new Hud(this, game);
this.blockMap = false;
+ this.blockHud = false;
player.turnStart();
hud.playerInfo.update(player, battle.getHudPosition(player));
@@ -201,15 +203,21 @@ public class Ctrl implements Disposable
this.state.enter(normal);
}
- public void touchDown(float x, float y)
+ public void touchDown(float hx, float hy, float mx, float my)
{
- if (!blockMap && state.downInMap(x, y))
+ if (!blockHud && hud.touchDown(hx, hy))
+ return;
+
+ if (!blockMap && state.downInMap(mx, my))
state.touchDown();
}
- public void touchUp(float x, float y)
+ public void touchUp(float hx, float hy, float mx, float my)
{
- if (!blockMap && state.upInMap(x, y))
+ if (!blockHud && hud.touchUp(hx, hy))
+ return;
+
+ if (!blockMap && state.upInMap(mx, my))
state.touchUp();
}