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:
@@ -6,7 +6,6 @@ var playerCount, startingLifeTotal, firstPlayerWide = false, lastPlayerWide = fa
|
|||||||
if ((typeof window.orientation !== "undefined") || (navigator.userAgent.indexOf('IEMobile') !== -1)) {
|
if ((typeof window.orientation !== "undefined") || (navigator.userAgent.indexOf('IEMobile') !== -1)) {
|
||||||
isMobile = true
|
isMobile = true
|
||||||
}
|
}
|
||||||
window.addEventListener("touchstart", switchToTouchEvents, true)
|
|
||||||
//This function sets everything up
|
//This function sets everything up
|
||||||
function fullscreen() {
|
function fullscreen() {
|
||||||
//Full screen!
|
//Full screen!
|
||||||
@@ -126,6 +125,7 @@ function startGame() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}, 100)
|
}, 100)
|
||||||
|
window.addEventListener("touchstart", switchToTouchEvents, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
function playerBox(playerBoxID, canvasRotation, wide) {
|
function playerBox(playerBoxID, canvasRotation, wide) {
|
||||||
@@ -148,7 +148,7 @@ function playerBox(playerBoxID, canvasRotation, wide) {
|
|||||||
document.addEventListener("mouseup", decoyMouseUpFunction, true)
|
document.addEventListener("mouseup", decoyMouseUpFunction, true)
|
||||||
}
|
}
|
||||||
function decoyMouseDownFunction() {
|
function decoyMouseDownFunction() {
|
||||||
alert("IT'S STILL CLICKING")
|
console.log("IT'S STILL CLICKING")
|
||||||
mouseDownPlayerBox(this, event.clientX, event.clientY)
|
mouseDownPlayerBox(this, event.clientX, event.clientY)
|
||||||
}
|
}
|
||||||
function decoyMouseUpFunction() {
|
function decoyMouseUpFunction() {
|
||||||
@@ -224,10 +224,10 @@ function updateBackgroundColor(color) {
|
|||||||
|
|
||||||
|
|
||||||
function switchToTouchEvents() {
|
function switchToTouchEvents() {
|
||||||
|
console.log("switching!")
|
||||||
window.removeEventListener("touchstart", switchToTouchEvents, true)
|
window.removeEventListener("touchstart", switchToTouchEvents, true)
|
||||||
document.removeEventListener("mouseup", decoyMouseUpFunction, true)
|
document.removeEventListener("mouseup", decoyMouseUpFunction, true)
|
||||||
for (var i = 1; i <= playerCount; i++) {
|
for (var i = 1; i <= playerCount; i++) {
|
||||||
alert("Currently being dumb: " + i)
|
|
||||||
playerList[i - 1].canvas.removeEventListener("mousedown", decoyMouseDownFunction, true)
|
playerList[i - 1].canvas.removeEventListener("mousedown", decoyMouseDownFunction, true)
|
||||||
playerList[i - 1].canvas.addEventListener("touchstart", function() {
|
playerList[i - 1].canvas.addEventListener("touchstart", function() {
|
||||||
mouseDownPlayerBox(this, event.clientX, event.clientY)
|
mouseDownPlayerBox(this, event.clientX, event.clientY)
|
||||||
@@ -237,3 +237,5 @@ function switchToTouchEvents() {
|
|||||||
}, true)
|
}, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// setTimeout(function(){switchToTouchEvents()}, 2000)
|
Reference in New Issue
Block a user