diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-12-09 21:56:05 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-12-09 21:56:05 +0100 |
commit | 7eb60cf7f72d34e95ff7388713121050366a774e (patch) | |
tree | b24a5726d890994117c383395cc60e582778c0dd | |
parent | b23dc623abcee4ca5d74c3ffb00a37183ff7e9ae (diff) | |
download | RustAndDust-7eb60cf7f72d34e95ff7388713121050366a774e.zip RustAndDust-7eb60cf7f72d34e95ff7388713121050366a774e.tar.gz |
Ctrl: an isInAnimation param to hid.touchDown(...)
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/Ctrl.java | 14 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/Hud.java | 4 |
2 files changed, 5 insertions, 13 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Ctrl.java b/core/src/ch/asynk/rustanddust/game/Ctrl.java index 4179ccd..0d414bc 100644 --- a/core/src/ch/asynk/rustanddust/game/Ctrl.java +++ b/core/src/ch/asynk/rustanddust/game/Ctrl.java @@ -221,7 +221,9 @@ public class Ctrl implements Disposable public void touchDown() { - if (!blockHud && hud.touchDown(hudTouch.x, hudTouch.y)) + boolean inAnimation = (this.stateType == StateType.ANIMATION); + + if (!blockHud && hud.touchDown(hudTouch.x, hudTouch.y, inAnimation)) return; if (!blockMap && state.downInMap(mapTouch.x, mapTouch.y)) @@ -244,16 +246,6 @@ public class Ctrl implements Disposable state.touchUp(); } - public boolean isInAction() - { - return (state != selectState); - } - - public boolean isInAnimation() - { - return (this.stateType == StateType.ANIMATION); - } - public void setAfterAnimationState(StateType after) { stateAfterAnimation = after; diff --git a/core/src/ch/asynk/rustanddust/game/Hud.java b/core/src/ch/asynk/rustanddust/game/Hud.java index 68b2eb5..033baaf 100644 --- a/core/src/ch/asynk/rustanddust/game/Hud.java +++ b/core/src/ch/asynk/rustanddust/game/Hud.java @@ -155,7 +155,7 @@ public class Hud implements Disposable, Animation return playerInfo.drag(x, y, dx, dy); } - public boolean touchDown(float x, float y) + public boolean touchDown(float x, float y, boolean isInAnimation) { hit = null; @@ -168,7 +168,7 @@ public class Hud implements Disposable, Animation return false; } - if (ctrl.isInAnimation()) + if (isInAnimation) return false; if (hit == null) { |