updated game text
This commit is contained in:
+7
-4
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user