Fixed broken controller.

This commit is contained in:
Greenscreener 2021-09-11 07:26:58 +02:00
parent 43c1c1c064
commit 62364b219b

View File

@ -15,7 +15,7 @@ document.onmouseup = function(e) {
}; };
document.ontouchend = function(e) { document.ontouchend = function(e) {
document.getElementById("slingshot").classList.add("ungrabbed"); document.getElementById("slingshot").classList.add("ungrabbed");
sendNudge(-Math.floor(e.touches[0].clientX - window.innerWidth / 2), Math.floor(e.touches[0].clientY - (window.innerHeight / 2))); sendNudge(-Math.floor(e.changedTouches[0].clientX - window.innerWidth / 2), Math.floor(e.changedTouches[0].clientY - (window.innerHeight / 2)));
}; };
document.ontouchstart = function(e) { document.ontouchstart = function(e) {
e.preventDefault(); e.preventDefault();