diff options
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Ctrl.java | 5 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/states/StateAnimation.java | 2 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/screens/GameScreen.java | 16 | ||||
-rwxr-xr-x | run | 18 |
4 files changed, 16 insertions, 25 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Ctrl.java b/core/src/ch/asynk/tankontank/game/Ctrl.java index cf08d3f..7149d56 100644 --- a/core/src/ch/asynk/tankontank/game/Ctrl.java +++ b/core/src/ch/asynk/tankontank/game/Ctrl.java @@ -99,11 +99,6 @@ public class Ctrl implements Disposable return (state != selectState); } - public boolean mayProcessTouch() - { - return (state != animationState); - } - public void setAnimationCount(int count) { animationCount = count; diff --git a/core/src/ch/asynk/tankontank/game/states/StateAnimation.java b/core/src/ch/asynk/tankontank/game/states/StateAnimation.java index 86bf61c..6738beb 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateAnimation.java +++ b/core/src/ch/asynk/tankontank/game/states/StateAnimation.java @@ -5,12 +5,14 @@ public class StateAnimation extends StateCommon @Override public void enter(StateType prevState) { + ctrl.blockMap = true; ctrl.hud.actionButtons.hide(); } @Override public void leave(StateType nextState) { + ctrl.blockMap = false; } @Override diff --git a/core/src/ch/asynk/tankontank/screens/GameScreen.java b/core/src/ch/asynk/tankontank/screens/GameScreen.java index efade05..13bb805 100644 --- a/core/src/ch/asynk/tankontank/screens/GameScreen.java +++ b/core/src/ch/asynk/tankontank/screens/GameScreen.java @@ -124,11 +124,9 @@ public class GameScreen implements Screen // blocked = false; if (button == Input.Buttons.LEFT) { dragPos.set(x, y); - if (ctrl.mayProcessTouch()) { - unprojectToHud(x, y, hudTouch); - unprojectToMap(x, y, mapTouch); - ctrl.touchDown(hudTouch.x, hudTouch.y, mapTouch.x, mapTouch.y); - } + unprojectToHud(x, y, hudTouch); + unprojectToMap(x, y, mapTouch); + ctrl.touchDown(hudTouch.x, hudTouch.y, mapTouch.x, mapTouch.y); } return true; } @@ -137,11 +135,9 @@ public class GameScreen implements Screen { // if (blocked) return true; if (button == Input.Buttons.LEFT) { - if (ctrl.mayProcessTouch()) { - unprojectToHud(x, y, hudTouch); - unprojectToMap(x, y, mapTouch); - ctrl.touchUp(hudTouch.x, hudTouch.y, mapTouch.x, mapTouch.y); - } + unprojectToHud(x, y, hudTouch); + unprojectToMap(x, y, mapTouch); + ctrl.touchUp(hudTouch.x, hudTouch.y, mapTouch.x, mapTouch.y); } // blocked = true; // inputDelay = INPUT_DELAY; @@ -1,7 +1,7 @@ #! /bin/bash [ -d out ] && rm -fr out -ARGS="desktop:run" +ARGS="desktop:run $@" function gradlew_do() { @@ -12,29 +12,27 @@ case "$1" in "c") ARGS="clean packs $ARGS $@" gradlew_do - shift ;; "a") - ARGS="android:installDebug android:run" + ARGS="android:installDebug android:run $@" gradlew_do echo "on failure: sudo adb kill-server; (sudo adb start-server;) sudo adb devices" - shift ;; "t") - ARGS="core:test" + ARGS="core:test $@" gradlew_do - shift ;; "j") - ARGS="core:compileJava" + ARGS="core:compileJava $@" gradlew_do - shift ;; "d") - ARGS="desktop:dist" + ARGS="desktop:dist $@" gradlew_do mv ./desktop/build/libs/desktop-1.0.jar TankOnTank.jar - shift + ;; + *) + gradlew_do ;; esac |