Workshop › 15 Puzzle › Step 10 of 27
Tiles will move and later even slide smoothly, so we redraw 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)
}
reset()
requestAnimationFrame(loop)
```loop draws once, then books itself for the next frame.draw() call.Above reset() at the bottom, write loop. Replace the last draw() with requestAnimationFrame(loop).
Skills: The game loop
← All the tiles The solved board from N →