updated game text
This commit is contained in:
+7
-4
@@ -101,7 +101,7 @@
|
|||||||
<span id="intro1" class="hidden title">QUICK</span>
|
<span id="intro1" class="hidden title">QUICK</span>
|
||||||
<span id="intro2" class="hidden title">DRAW</span>
|
<span id="intro2" class="hidden title">DRAW</span>
|
||||||
|
|
||||||
<!-- gamemode menu button-->
|
<!-- gamemode menu buttons-->
|
||||||
<div id="game-modes" class="hidden fade">
|
<div id="game-modes" class="hidden fade">
|
||||||
<button id="normal" onclick="handleNormalMode()">normal mode</button>
|
<button id="normal" onclick="handleNormalMode()">normal mode</button>
|
||||||
<button id="infinite">infinite mode</button>
|
<button id="infinite">infinite mode</button>
|
||||||
@@ -152,6 +152,7 @@
|
|||||||
let currentRound = 0;
|
let currentRound = 0;
|
||||||
let countingDown = false;
|
let countingDown = false;
|
||||||
|
|
||||||
|
let totalTime = 0.0;
|
||||||
let roundTimeStart = 0;
|
let roundTimeStart = 0;
|
||||||
let roundTimeEnd = 0;
|
let roundTimeEnd = 0;
|
||||||
let roundSeconds = 0.0;
|
let roundSeconds = 0.0;
|
||||||
@@ -232,6 +233,7 @@
|
|||||||
console.log("game mode: " + gamemode);
|
console.log("game mode: " + gamemode);
|
||||||
|
|
||||||
currentRound = 1;
|
currentRound = 1;
|
||||||
|
totalTime = 0;
|
||||||
|
|
||||||
center.addEventListener("mouseover", handleHoverStart);
|
center.addEventListener("mouseover", handleHoverStart);
|
||||||
center.addEventListener("mouseleave", handleHoverEnd);
|
center.addEventListener("mouseleave", handleHoverEnd);
|
||||||
@@ -305,11 +307,12 @@
|
|||||||
}
|
}
|
||||||
roundTimeEnd = Date.now();
|
roundTimeEnd = Date.now();
|
||||||
roundSeconds = (roundTimeEnd - roundTimeStart) / 1000;
|
roundSeconds = (roundTimeEnd - roundTimeStart) / 1000;
|
||||||
|
totalTime += roundSeconds;
|
||||||
|
|
||||||
currentRound++;
|
currentRound++;
|
||||||
|
|
||||||
console.log('ROUND ' + currentRound + ' TIME: ' + roundSeconds);
|
console.log("ROUND: " + roundSeconds + "s\nTOTAL: " + totalTime + "\nhover on bullseye to start round " + currentRound);
|
||||||
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";
|
gameText.style.display = "inline";
|
||||||
gameText.style.opacity = "100";
|
gameText.style.opacity = "100";
|
||||||
|
|
||||||
@@ -384,7 +387,7 @@
|
|||||||
gameText.innerText = "click the targets as quickly as possible!\nhover on bullseye to start.";
|
gameText.innerText = "click the targets as quickly as possible!\nhover on bullseye to start.";
|
||||||
}
|
}
|
||||||
else {
|
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";
|
gameText.style.display = "inline";
|
||||||
countingDown = false;
|
countingDown = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user