diff options
author | quou <quou@disroot.org> | 2024-10-01 20:38:27 +1000 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-10-01 20:38:27 +1000 |
commit | f06c36339c3c4d1c3287f710c6963c643bc5219d (patch) | |
tree | 58fc338c065ddf212e9245b8b6241e688f103f1e | |
parent | 25223a71460075b9b4f1cf8df82d89dafde24423 (diff) |
World frame timer
-rw-r--r-- | world.c | 2 | ||||
-rw-r--r-- | world.h | 1 |
2 files changed, 3 insertions, 0 deletions
@@ -5,6 +5,7 @@ void init_world(World* w) { w->particle_count = 0; w->enemy_count = 0; w->deathzone_count = 0; + w->frame = 0; init_player(&w->player); } @@ -63,6 +64,7 @@ void update_world(World* w, const App* a) { for (i = w->enemy_count - 1; i >= 0; i--) if (update_enemy(&w->enemies[i], w)) w->enemies[i] = w->enemies[--w->enemy_count]; + w->frame++; } void ren_world(const World* w, struct Renderer* r) { @@ -18,6 +18,7 @@ typedef struct World { int deathzone_count; Player player; Map map; + int frame; } World; void init_world(World* w); |