code: function frame () {
      if (!animationActive) return
      const expectedFrameNumber = (Date.now() - animationStartTime) / 1000 * 60
      const updateCount = Math.min(expectedFrameNumber - lastFrameNumber, 10)
      lastFrameNumber = expectedFrameNumber
      for (let i = 0; i < updateCount; i++) {
        update()
        if (!shouldAnimate()) {
          animationActive = false
          break
        }
      }
      draw()
      if (animationActive) {
        window.requestAnimationFrame(frame)
      }
    }
docs: The animation frame. Calls update (handle frameskip) and draw.