Update life.js

This commit is contained in:
Kyle
2019-08-15 17:22:30 -07:00
parent e8d0779166
commit 5392742c77

View File

@@ -332,11 +332,11 @@ function switchToTouchEvents() {
window.addEventListener("touchend", endTouch, true) window.addEventListener("touchend", endTouch, true)
} }
function startTouch() { function startTouch() {
touchX = [], touchY = [] // touchX = [], touchY = []
for (var i = 0; i < event.touches.length; i ++) { // for (var i = 0; i < event.touches.length; i ++) {
touchX[i] = event.touches[i].clientX // touchX[i] = event.touches[i].clientX
touchY[i] = event.touches[i].clientY // touchY[i] = event.touches[i].clientY
} // }
if (event.touches.length > 0) { if (event.touches.length > 0) {
if (!clicking) { if (!clicking) {
updatePlayerBoxes() updatePlayerBoxes()
@@ -352,11 +352,11 @@ function moveTouch() {
} }
} }
function endTouch() { function endTouch() {
touchX = [], touchY = [] // touchX = [], touchY = []
for (var i = 0; i < event.touches.length; i ++) { // for (var i = 0; i < event.touches.length; i ++) {
touchX[i] = event.touches[i].clientX // touchX[i] = event.touches[i].clientX
touchY[i] = event.touches[i].clientY // touchY[i] = event.touches[i].clientY
} // }
if (event.touches.length < 1) { if (event.touches.length < 1) {
clicking = false clicking = false
clearTimeout(loop) clearTimeout(loop)