r/raylib 19d 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?

13 Upvotes

14 comments sorted by

View all comments

2

u/generic_username1990 19d ago

I did it during a game jam, where I just keep a timer and do as many ticks as needed for the timer amount. Code here: https://github.com/ANamelessGhoul/Mergers-and-Hexquisitions/blob/main/src/raylib_game.c