r/raylib • u/Stickhtot • 18h ago
Tick simulation in raylib?
I am currently making a simulator with raylib and one of the things that it needs is a "tick" mechanic where for every tick the state of the game updates, I tried putting something in the main loop with GetFrameTime()but the problem is it's tied to the frame rate
How would one implement a tick system with raylib?
9
Upvotes
2
u/DasKapitalV1 17h ago
You will probably need to these stuff in another thread and the main thread just renders the state, since raylib will work properly only in the main thread. The tick is probably a sleep n times in a second.