Skip to content

Commit 07bcdc9

Browse files
committed
Debugging and Tweaks
1 parent 5b2be53 commit 07bcdc9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Intermediate_JavaScript/GamePlay_setup_Values.html

+13
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@
103103
message.innerHTML = "Match Found";
104104
cardFlipped = -1;
105105
playLockout = false;
106+
// Conclude the game
107+
if (tfo.length == tileArray.length) {
108+
gameover();
109+
}
106110
} else {
107111
message.innerHTML = "No Match";
108112
timer = setInterval(hideCard, 1000);
@@ -117,6 +121,15 @@
117121
}
118122
}
119123

124+
function gameover() {
125+
message.innerHTML = "GAME OVER";
126+
sb.style.display = "block";
127+
gamePlay = false;
128+
tfo = [];
129+
tileImages = [];
130+
gameBoard.innerHTML = "";
131+
}
132+
120133
function isinArray(v, array) {
121134
return array.indexOf(v) > -1;
122135
}

0 commit comments

Comments
 (0)