Update: CC - Touch Move (c55930et90.js) 133 bytes modified
parent
ab2eebf8c0
commit
e53648c594
|
@ -7,14 +7,20 @@ if (!this.initialized) {
|
||||||
this.x = window.innerWidth / 2;
|
this.x = window.innerWidth / 2;
|
||||||
this.y = window.innerHeight / 2;
|
this.y = window.innerHeight / 2;
|
||||||
|
|
||||||
|
var sensitivity = 0.1;
|
||||||
|
|
||||||
this.initialized = true;
|
this.initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
touch.left *= sensitivity;
|
||||||
|
touch.right *= sensitivity;
|
||||||
|
touch.up *= sensitivity;
|
||||||
|
touch.down *= sensitivity;
|
||||||
|
|
||||||
this.x -= touch.left;
|
this.x -= touch.left;
|
||||||
this.x += touch.right;
|
this.x += touch.right;
|
||||||
|
|
||||||
this.y += touch.down;
|
|
||||||
this.y -= touch.up;
|
this.y -= touch.up;
|
||||||
|
this.y += touch.down;
|
||||||
|
|
||||||
if (this.x < 0) {
|
if (this.x < 0) {
|
||||||
this.x = 0;
|
this.x = 0;
|
||||||
|
|
Loading…
Reference in New Issue