mirror of
https://github.com/Investigamer/cardconjurer.git
synced 2025-07-28 05:41:55 -05:00
Update life.js
This commit is contained in:
@@ -311,18 +311,15 @@ window.addEventListener("mouseup", endMouseCoordinates, true)
|
|||||||
function startMouseCoordinates() {
|
function startMouseCoordinates() {
|
||||||
clicking = true
|
clicking = true
|
||||||
updatePlayerBoxes()
|
updatePlayerBoxes()
|
||||||
alert("still clicking")
|
|
||||||
}
|
}
|
||||||
function updateMouseCoordinates() {
|
function updateMouseCoordinates() {
|
||||||
touchX[0] = event.clientX
|
touchX[0] = event.clientX
|
||||||
touchY[0] = event.clientY
|
touchY[0] = event.clientY
|
||||||
alert("still clicking")
|
|
||||||
}
|
}
|
||||||
function endMouseCoordinates() {
|
function endMouseCoordinates() {
|
||||||
clearTimeout(loop)
|
clearTimeout(loop)
|
||||||
clearTimers()
|
clearTimers()
|
||||||
clicking = false
|
clicking = false
|
||||||
alert("still clicking")
|
|
||||||
}
|
}
|
||||||
window.addEventListener("touchstart", switchToTouchEvents, true)
|
window.addEventListener("touchstart", switchToTouchEvents, true)
|
||||||
function switchToTouchEvents() {
|
function switchToTouchEvents() {
|
||||||
@@ -335,16 +332,15 @@ function switchToTouchEvents() {
|
|||||||
window.addEventListener("touchend", endTouch, true)
|
window.addEventListener("touchend", endTouch, true)
|
||||||
}
|
}
|
||||||
function startTouch() {
|
function startTouch() {
|
||||||
alert("start touch")
|
|
||||||
if (event.touches.length > 0) {
|
if (event.touches.length > 0) {
|
||||||
if (!clicking) {
|
if (!clicking) {
|
||||||
updatePlayerBoxes()
|
updatePlayerBoxes()
|
||||||
|
alert("just ran it?")
|
||||||
}
|
}
|
||||||
clicking = true
|
clicking = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function moveTouch() {
|
function moveTouch() {
|
||||||
alert("move touch")
|
|
||||||
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
|
||||||
@@ -352,10 +348,10 @@ function moveTouch() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function endTouch() {
|
function endTouch() {
|
||||||
alert("end touch")
|
|
||||||
if (event.touches.length < 1) {
|
if (event.touches.length < 1) {
|
||||||
clicking = false
|
clicking = false
|
||||||
clearTimeout(loop)
|
clearTimeout(loop)
|
||||||
clearTimers()
|
clearTimers()
|
||||||
|
alert("just cancelled everything")
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user