diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-01-06 11:26:46 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-01-06 11:26:46 +0100 |
commit | 7a3aeabfd8d758944421b71db3e18aacf77bc4de (patch) | |
tree | cb327ebd73a5bb93f645a94526b59acc7ec1fa89 /core/src/ch/asynk/tankontank/game | |
parent | 9faa5b5c7b49064766bf1fa57509e7ecf1b40981 (diff) | |
download | RustAndDust-7a3aeabfd8d758944421b71db3e18aacf77bc4de.zip RustAndDust-7a3aeabfd8d758944421b71db3e18aacf77bc4de.tar.gz |
GameScreen,Ctrl: mapTouch,hudTouch leave GameScreen for Ctrl
Diffstat (limited to 'core/src/ch/asynk/tankontank/game')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Ctrl.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Ctrl.java b/core/src/ch/asynk/tankontank/game/Ctrl.java index 63a372a..d4c38e8 100644 --- a/core/src/ch/asynk/tankontank/game/Ctrl.java +++ b/core/src/ch/asynk/tankontank/game/Ctrl.java @@ -2,6 +2,8 @@ package ch.asynk.tankontank.game; import com.badlogic.gdx.utils.Disposable; +import com.badlogic.gdx.math.Vector3; + import ch.asynk.tankontank.TankOnTank; import ch.asynk.tankontank.ui.Position; import ch.asynk.tankontank.game.State.StateType; @@ -29,6 +31,9 @@ public class Ctrl implements Disposable public boolean blockMap; public boolean blockHud; + public Vector3 mapTouch = new Vector3(); + public Vector3 hudTouch = new Vector3(); + private State selectState; private State pathState; private State rotateState; @@ -245,21 +250,21 @@ public class Ctrl implements Disposable } - public void touchDown(float hx, float hy, float mx, float my) + public void touchDown() { - if (!blockHud && hud.touchDown(hx, hy)) + if (!blockHud && hud.touchDown(hudTouch.x, hudTouch.y)) return; - if (!blockMap && state.downInMap(mx, my)) + if (!blockMap && state.downInMap(mapTouch.x, mapTouch.y)) state.touchDown(); } - public void touchUp(float hx, float hy, float mx, float my) + public void touchUp() { - if (!blockHud && hud.touchUp(hx, hy)) + if (!blockHud && hud.touchUp(hudTouch.x, hudTouch.y)) return; - if (!blockMap && state.upInMap(mx, my)) + if (!blockMap && state.upInMap(mapTouch.x, mapTouch.y)) state.touchUp(); } |