mirror of
https://github.com/Investigamer/cardconjurer.git
synced 2025-07-27 05:14:53 -05:00
Update life.js
This commit is contained in:
@@ -2,12 +2,14 @@
|
|||||||
// Card Conjurer, by Kyle Burton //
|
// Card Conjurer, by Kyle Burton //
|
||||||
//============================================//
|
//============================================//
|
||||||
//define variables
|
//define variables
|
||||||
var playerCount, startingLifeTotal, firstPlayerWide = false, lastPlayerWide = false, playerList = [], rowHeight = 0, columnWidth = 0, rowCount = 0, isFullscreen = true, mouseClickId = 0, noSleep = new NoSleep()
|
var playerCount, startingLifeTotal, firstPlayerWide = false, lastPlayerWide = false, playerList = [], rowHeight = 0, columnWidth = 0, rowCount = 0, isFullscreen = true, mouseClickId = 0, noSleep = new NoSleep(), canEnableNoSleep = false
|
||||||
//Setup the enabler for no sleep
|
//Setup the enabler for no sleep
|
||||||
document.addEventListener("click", enableNoSleep, false);
|
document.addEventListener("click", enableNoSleep, false);
|
||||||
function enableNoSleep() {
|
function enableNoSleep() {
|
||||||
|
if (canEnableNoSleep) {
|
||||||
document.removeEventListener("click", enableNoSleep, false);
|
document.removeEventListener("click", enableNoSleep, false);
|
||||||
noSleep.enable();
|
noSleep.enable();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//This function sets everything up
|
//This function sets everything up
|
||||||
function fullscreen() {
|
function fullscreen() {
|
||||||
@@ -28,6 +30,7 @@ function fullscreen() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function startGame() {
|
function startGame() {
|
||||||
|
canEnableNoSleep = document.getElementById("inputWakeLock").checked
|
||||||
fullscreen()
|
fullscreen()
|
||||||
document.getElementById("return").classList.remove("hidden")
|
document.getElementById("return").classList.remove("hidden")
|
||||||
//hide the settings and grab player count and starting life total
|
//hide the settings and grab player count and starting life total
|
||||||
|
Reference in New Issue
Block a user