diff --git a/controller/controller.js b/controller/controller.js index fb1839d..bb771fa 100644 --- a/controller/controller.js +++ b/controller/controller.js @@ -15,7 +15,7 @@ document.onmouseup = function(e) { }; document.ontouchend = function(e) { 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) { e.preventDefault();