summaryrefslogtreecommitdiff
path: root/quickdraw-game.html
diff options
context:
space:
mode:
Diffstat (limited to 'quickdraw-game.html')
-rw-r--r--quickdraw-game.html11
1 files changed, 7 insertions, 4 deletions
diff --git a/quickdraw-game.html b/quickdraw-game.html
index cf175ad..53d9ebf 100644
--- a/quickdraw-game.html
+++ b/quickdraw-game.html
@@ -101,7 +101,7 @@
<span id="intro1" class="hidden title">QUICK</span>
<span id="intro2" class="hidden title">DRAW</span>
- <!-- gamemode menu button-->
+ <!-- gamemode menu buttons-->
<div id="game-modes" class="hidden fade">
<button id="normal" onclick="handleNormalMode()">normal mode</button>
<button id="infinite">infinite mode</button>
@@ -152,6 +152,7 @@
let currentRound = 0;
let countingDown = false;
+ let totalTime = 0.0;
let roundTimeStart = 0;
let roundTimeEnd = 0;
let roundSeconds = 0.0;
@@ -232,6 +233,7 @@
console.log("game mode: " + gamemode);
currentRound = 1;
+ totalTime = 0;
center.addEventListener("mouseover", handleHoverStart);
center.addEventListener("mouseleave", handleHoverEnd);
@@ -305,11 +307,12 @@
}
roundTimeEnd = Date.now();
roundSeconds = (roundTimeEnd - roundTimeStart) / 1000;
+ totalTime += roundSeconds;
currentRound++;
- console.log('ROUND ' + currentRound + ' TIME: ' + roundSeconds);
- gameText.innerText = "TIME: " + roundSeconds + "\nhover on bullseye to start round " + currentRound;
+ console.log("ROUND: " + roundSeconds + "s\nTOTAL: " + totalTime + "\nhover on bullseye to start round " + currentRound);
+ gameText.innerText = "ROUND: " + roundSeconds + "s\nTOTAL: " + totalTime + "s\nhover on bullseye to start round " + currentRound;
gameText.style.display = "inline";
gameText.style.opacity = "100";
@@ -384,7 +387,7 @@
gameText.innerText = "click the targets as quickly as possible!\nhover on bullseye to start.";
}
else {
- gameText.innerText = "TIME: " + roundSeconds + "\nhover on bullseye to start round " + currentRound;
+ gameText.innerText = "ROUND: " + roundSeconds + "s\nTOTAL: " + totalTime + "s\nhover on bullseye to start round " + currentRound;
}
gameText.style.display = "inline";
countingDown = false;