From fd2520a08605cabd25665bebb056b7a7ef1a8dbf Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Fri, 29 Sep 2017 06:58:45 +0200 Subject: [PATCH] counter action for left / right --- src/game-lib-system-input.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/game-lib-system-input.js b/src/game-lib-system-input.js index bcecdc6..bb36903 100644 --- a/src/game-lib-system-input.js +++ b/src/game-lib-system-input.js @@ -264,18 +264,22 @@ GameLib.System.Input.prototype.onTouchMove = function(touchControl) { if (event.changedTouches[t].pageX > this.touches[id].pageX) { right = 1; + left -= 1; } if (event.changedTouches[t].pageX < this.touches[id].pageX) { left = 1; + right -= 1; } if (event.changedTouches[t].pageY < this.touches[id].pageY) { up = 1; + down -= 1; } if (event.changedTouches[t].pageY > this.touches[id].pageY) { down = 1; + up -= 1; } this.touches[id].right += right;