* Ends the game by setting IsPlaying to false, * finally resets the score, time and enables btnStart.
()
| 112 | * finally resets the score, time and enables btnStart. |
| 113 | */ |
| 114 | function endGame() { |
| 115 | IsPlaying = false; |
| 116 | alert("Your score is " + score); |
| 117 | //reset score and time for next game. |
| 118 | score = 0; |
| 119 | time = 30; |
| 120 | //enable the button to make it clickable |
| 121 | btnStart.removeAttribute('disabled'); |
| 122 | } |