mirror of
https://github.com/Investigamer/cardconjurer.git
synced 2025-07-27 13:21:41 -05:00
Update life.js
This commit is contained in:
@@ -332,12 +332,15 @@ function switchToTouchEvents() {
|
|||||||
window.addEventListener("touchend", endTouch, true)
|
window.addEventListener("touchend", endTouch, true)
|
||||||
}
|
}
|
||||||
function startTouch() {
|
function startTouch() {
|
||||||
if (!clicking) {
|
touchX = [], touchY = []
|
||||||
if (event.touches.length > 0) {
|
for (var i = 0; i < event.touches.length; i ++) {
|
||||||
clicking = true
|
touchX[i] = event.touches[i].clientX
|
||||||
|
touchY[i] = event.touches[i].clientY
|
||||||
|
}
|
||||||
|
if (event.touches.length > 0) {
|
||||||
|
if (!clicking) {
|
||||||
|
updatePlayerBoxes()
|
||||||
}
|
}
|
||||||
updatePlayerBoxes()
|
|
||||||
} else if (event.touches.length > 0) {
|
|
||||||
clicking = true
|
clicking = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -349,6 +352,11 @@ function moveTouch() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function endTouch() {
|
function endTouch() {
|
||||||
|
touchX = [], touchY = []
|
||||||
|
for (var i = 0; i < event.touches.length; i ++) {
|
||||||
|
touchX[i] = event.touches[i].clientX
|
||||||
|
touchY[i] = event.touches[i].clientY
|
||||||
|
}
|
||||||
clearTimeout(loop)
|
clearTimeout(loop)
|
||||||
clearTimers()
|
clearTimers()
|
||||||
if (event.touches.length < 1) {
|
if (event.touches.length < 1) {
|
||||||
|
Reference in New Issue
Block a user