Workshop › Hangman › Step 9 of 36
The picture must follow every guess, so we redraw it all the time: a loop that draws and asks the browser to run it again before the next screen refresh.
```js
function loop() {
draw()
requestAnimationFrame(loop)
}
newWord()
requestAnimationFrame(loop)
```loop draws once, then books itself for the next frame, so it keeps going.draw() call.Above newWord() at the bottom, write the loop function. Replace the last draw() with requestAnimationFrame(loop).
Skills: The game loop
← Remember the guesses A guess →