File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ canvas {
82
82
margin-bottom : 20px ;
83
83
}
84
84
85
- # alertMsg {
85
+ # scoreModal {
86
86
color : brown;
87
87
font-weight : bolder;
88
88
}
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ <h2 class="mt-3"><span class="result"><img src="images/apple.png" alt="fruit"></
33
33
< div class ="modal-content ">
34
34
< div class ="modal-body ">
35
35
< img id ="snake " src ="images/snake.png " alt ="snake ">
36
- < p > Game Over! Your Score is: < span id ="alertMsg "> </ span > </ p >
36
+ < p > Game Over! Your Score is: < span id ="scoreModal "> </ span > </ p >
37
37
</ div >
38
38
< div class ="modal-footer ">
39
39
< button type ="button " class ="btn modal-btn " data-dismiss ="modal "> Ok</ button >
Original file line number Diff line number Diff line change @@ -21,9 +21,9 @@ var playing, gameStarted;
21
21
var boundaryCollision ;
22
22
var tail0 ;
23
23
24
- var alertModal = document . getElementById ( "alertModal" ) ;
25
- var alertMsg = document . getElementById ( "alertMsg" ) ;
26
- var modalBtn = document . querySelector ( ".modal-btn" ) ;
24
+ // var alertModal = document.getElementById("alertModal");
25
+ // var alertMsg = document.getElementById("alertMsg");
26
+ // var modalBtn = document.querySelector(".modal-btn");
27
27
28
28
29
29
startBtn . addEventListener ( "click" , startGame ) ;
@@ -242,7 +242,7 @@ function drawSnake() {
242
242
}
243
243
drawSnakeHead ( "red" ) ;
244
244
setTimeout ( ( ) => {
245
- alertMsg . textContent = totalTail ;
245
+ scoreModal . textContent = totalTail ;
246
246
$ ( '#alertModal' ) . modal ( 'show' ) ;
247
247
$ ( "#alertModal" ) . on ( 'shown.bs.modal' , function ( ) {
248
248
window . removeEventListener ( "keydown" , pressedKey ) ;
You can’t perform that action at this time.
0 commit comments