Game loop in script best practices?

How should one create a game loop in Cospaces?

I’ve been using:

Time.scheduleRepeating(() => { // Main game loop })}, 0.1)

Is this the best way?

Thanks

1 Like

Hi @jlfjlf,

For best practice in game-making in Javascript, remix and study the following demo from the CoSpaces Team:

Hope that helps! Let me know if you have any further questions about this. If this solves your problem, please mark this post as the Solution.

Many thanks,
Geoff @ TechLeap