counter action for left / right

beta.r3js.org
-=yb4f310 2017-09-29 06:58:45 +02:00
parent 45e3195d8f
commit fd2520a086
1 changed files with 4 additions and 0 deletions

View File

@ -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;