summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/world.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/world.c b/src/world.c
index 9eede87..bff0345 100644
--- a/src/world.c
+++ b/src/world.c
@@ -1435,7 +1435,12 @@ static void world_run_simulation_tick(world* world)
void world_update(platform_window* window, world* world)
{
- world_run_simulation_tick(world);
+ static float delta = 0;
+ delta += frame_delta;
+ if (delta >= (1/60.0f)) { // tick runs at 60 ticks per second regardless of fps.
+ world_run_simulation_tick(world);
+ delta = 0;
+ }
}
static vec2f get_world_location_for_job(platform_window* window, world* world, active_job* job)