()
| 214 | |
| 215 | //check for a game over |
| 216 | function checkForGameOver() { |
| 217 | if (squares[pacmanCurrentIndex].classList.contains('ghost') && |
| 218 | !squares[pacmanCurrentIndex].classList.contains('scared-ghost')) { |
| 219 | ghosts.forEach(ghost => clearInterval(ghost.timerId)) |
| 220 | document.removeEventListener('keyup', movePacman) |
| 221 | setTimeout(function(){ alert("Game Over"); }, 500) |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | //check for a win - more is when this score is reached |
| 226 | function checkForWin() { |
no outgoing calls
no test coverage detected