-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgameEnd.js
31 lines (26 loc) · 907 Bytes
/
gameEnd.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// overlayButton
var overlayBtn = document.getElementById("overlayButton");
// overlayBtn.addEventListener("click", on);
function goodGame(title, description, image, sfx) {
var win = new Audio(sfx);
document.getElementById("victoryName").innerHTML = (title);
document.getElementById("victoryDesc").innerHTML = (description);
document.getElementById("victoryImg").src = (image);
if (audioMuted == false) {
win.play();
}
on()
}
function on() {
timerPause()
document.getElementById("overlay").style.display = "block";
console.log('off() to go back to game?')
document.getElementById("count2").innerHTML = (document.getElementById("count").innerHTML);
$('#count').hide()
$('#count2').show()
}
function off() {
timerStart()
document.getElementById("overlay").style.display = "none";
console.log('on() to end it again, to idk why')
}