From d8797c65eb7ebd7ab432ff4726186c8b80777680 Mon Sep 17 00:00:00 2001 From: Jérémy Zurcher Date: Mon, 6 Oct 2014 19:38:41 +0200 Subject: GameCtrl: replace inAnimation() with mayProcessTouch() --- core/src/ch/asynk/tankontank/screens/GameScreen.java | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'core/src/ch/asynk/tankontank/screens') diff --git a/core/src/ch/asynk/tankontank/screens/GameScreen.java b/core/src/ch/asynk/tankontank/screens/GameScreen.java index e3f6a654..696cfd16 100644 --- a/core/src/ch/asynk/tankontank/screens/GameScreen.java +++ b/core/src/ch/asynk/tankontank/screens/GameScreen.java @@ -112,10 +112,12 @@ public class GameScreen implements Screen { if (button == Input.Buttons.LEFT) { dragPos.set(x, y); - unprojectToHud(x, y, touchPos); - if (!ctrl.hud.touchDown(touchPos.x, touchPos.y)) { - unprojectToMap(x, y, touchPos); - ctrl.touchDown(touchPos.x, touchPos.y); + if (ctrl.mayProcessTouch()) { + unprojectToHud(x, y, touchPos); + if (!ctrl.hud.touchDown(touchPos.x, touchPos.y)) { + unprojectToMap(x, y, touchPos); + ctrl.touchDown(touchPos.x, touchPos.y); + } } } @@ -125,10 +127,12 @@ public class GameScreen implements Screen public boolean touchUp(int x, int y, int pointer, int button) { if (button == Input.Buttons.LEFT) { - unprojectToHud(x, y, touchPos); - if (!ctrl.hud.touchUp(touchPos.x, touchPos.y)) { - unprojectToMap(x, y, touchPos); - ctrl.touchUp(touchPos.x, touchPos.y); + if (ctrl.mayProcessTouch()) { + unprojectToHud(x, y, touchPos); + if (!ctrl.hud.touchUp(touchPos.x, touchPos.y)) { + unprojectToMap(x, y, touchPos); + ctrl.touchUp(touchPos.x, touchPos.y); + } } } return true; -- cgit v1.2.3