diff --git a/src/game-lib-system-input.js b/src/game-lib-system-input.js index 9842c1f..f16862e 100644 --- a/src/game-lib-system-input.js +++ b/src/game-lib-system-input.js @@ -248,11 +248,15 @@ GameLib.System.Input.prototype.onTouchMove = function(touchControl) { this.sensitivityCounter++; if (this.sensitivityCounter < touchControl.sensitivity) { + + console.log(this.sensitivityCounter); + return; } else { this.sensitivityCounter = 0; } + for (var t = 0; t < event.changedTouches.length; t++) { var id = event.changedTouches[t].identifier; @@ -264,22 +268,18 @@ 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; @@ -302,6 +302,9 @@ GameLib.System.Input.prototype.onTouchMove = function(touchControl) { }; GameLib.System.Input.prototype.onTouchCancel = function(event) { + + this.sensitivityCounter = 0; + for (var t = 0; t < event.changedTouches.length; t++) { this.touches[event.changedTouches[t].identifier].cancelled = true; this.touches[event.changedTouches[t].identifier].event = event; @@ -314,6 +317,9 @@ GameLib.System.Input.prototype.onTouchCancel = function(event) { }; GameLib.System.Input.prototype.onTouchEnd = function(event) { + + this.sensitivityCounter = 0; + for (var t = 0; t < event.changedTouches.length; t++) { this.touches[event.changedTouches[t].identifier].ended = true; this.touches[event.changedTouches[t].identifier].event = event;