Update life.js

This commit is contained in:
Kyle
2019-08-18 16:49:52 -07:00
parent f4141c9d9a
commit acc02a5355

View File

@@ -2,13 +2,15 @@
// Card Conjurer, by Kyle Burton //
//============================================//
//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
document.addEventListener("click", enableNoSleep, false);
function enableNoSleep() {
if (canEnableNoSleep) {
document.removeEventListener("click", enableNoSleep, false);
noSleep.enable();
}
}
//This function sets everything up
function fullscreen() {
//Full screen!
@@ -28,6 +30,7 @@ function fullscreen() {
}
}
function startGame() {
canEnableNoSleep = document.getElementById("inputWakeLock").checked
fullscreen()
document.getElementById("return").classList.remove("hidden")
//hide the settings and grab player count and starting life total