Workshop › Minesweeper › Step 4 of 26
The field will change with every click, and later a clock will tick. A loop redraws it before every screen refresh.
```js
function loop() {
draw()
requestAnimationFrame(loop)
}
newGame()
requestAnimationFrame(loop)
```loop draws, then books itself for the next frame.draw() call.Above newGame() at the bottom, write loop. Replace the last draw() with requestAnimationFrame(loop).
Skills: The game loop