Animation controller question

Samba dance, I want to play the entire animation frame with just one click, rather than keep pressing ‘B’.
Is there a good implementation method replace setTimeout

Original code:

animating = true;

Simple implementation method:

const delay = / 60
      if(inputMap["b"]) {
          setTimeout(() => {
              animating = true
          }, delay * 1000)
      } else {
          animating = true

Looks like you don’t need control in the renderLoop. Press the ‘f’ to start.


This is indeed a good way