()
| 45 | } |
| 46 | |
| 47 | function startGame() { |
| 48 | |
| 49 | scoreBoard.textContent = 0; |
| 50 | score = 0 |
| 51 | timeUp = false; |
| 52 | peep(); |
| 53 | setTimeout(() => { |
| 54 | timeUp = true; |
| 55 | if (score > hscore) { |
| 56 | console.log("score is greater"); |
| 57 | highscore.textContent = score; |
| 58 | localStorage.setItem('highscore', score); |
| 59 | console.log("hscore:", hscore); |
| 60 | } |
| 61 | }, 10000) |
| 62 | } |
| 63 | |
| 64 | function bonk(e) { |
| 65 | if (!e.isTrusted) return; //cheater |