()
| 224 | |
| 225 | //check for a win - more is when this score is reached |
| 226 | function checkForWin() { |
| 227 | if (score === 274) { |
| 228 | ghosts.forEach(ghost => clearInterval(ghost.timerId)) |
| 229 | document.removeEventListener('keyup', movePacman) |
| 230 | setTimeout(function(){ alert("You have WON!"); }, 500) |
| 231 | } |
| 232 | } |
| 233 | }) |
| 234 |