Closed hyejinim closed 4 years ago
Try p5js play library https://creative-coding.decontextualize.com/making-games-with-p5-play/
two options: InvokeRepeating() or Coroutines with yield WaitForSeconds.
if (frameCount % 20 == 0) { // update every 20 frames spr.position.x = frames[frameNum].x; spr.position.y = frames[frameNum].y; spr.scale = frames[frameNum].scale; frameNum++; }
Revert the framerate and find another way to show animations (do not change every frame)