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 @@
QUICK
DRAW
-
+
@@ -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;