counter action for left / right
parent
45e3195d8f
commit
fd2520a086
|
@ -264,18 +264,22 @@ GameLib.System.Input.prototype.onTouchMove = function(touchControl) {
|
||||||
|
|
||||||
if (event.changedTouches[t].pageX > this.touches[id].pageX) {
|
if (event.changedTouches[t].pageX > this.touches[id].pageX) {
|
||||||
right = 1;
|
right = 1;
|
||||||
|
left -= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.changedTouches[t].pageX < this.touches[id].pageX) {
|
if (event.changedTouches[t].pageX < this.touches[id].pageX) {
|
||||||
left = 1;
|
left = 1;
|
||||||
|
right -= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.changedTouches[t].pageY < this.touches[id].pageY) {
|
if (event.changedTouches[t].pageY < this.touches[id].pageY) {
|
||||||
up = 1;
|
up = 1;
|
||||||
|
down -= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.changedTouches[t].pageY > this.touches[id].pageY) {
|
if (event.changedTouches[t].pageY > this.touches[id].pageY) {
|
||||||
down = 1;
|
down = 1;
|
||||||
|
up -= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.touches[id].right += right;
|
this.touches[id].right += right;
|
||||||
|
|
Loading…
Reference in New Issue