* Performs countDown and the displays the time left. * if the time has end it will end the game *
()
| 97 | * |
| 98 | */ |
| 99 | function countDown() { |
| 100 | time = time - 1; |
| 101 | timeBoard.innerText = time; |
| 102 | if (time == 0) { |
| 103 | //clear the interval by using the timer refrence |
| 104 | clearInterval(timer); |
| 105 | //call end game |
| 106 | endGame(); |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * Ends the game by setting IsPlaying to false, |