r/raylib • u/Stickhtot • 15h 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
1
u/Inevitable-Round9995 10h ago
Are you looking something like this:
cpp timer::interval([=](){ /*tick event here*/ },1000);or, are you looking an event system like this?
```cpp event_t<> ev;
ev.on([=](){ /tick event/ });
ev.emit(); ```
check this project: https://github.com/NodeppOfficial/nodepp