aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--world.c2
-rw-r--r--world.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/world.c b/world.c
index 2b6187e..98950f1 100644
--- a/world.c
+++ b/world.c
@@ -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) {
diff --git a/world.h b/world.h
index 14e2447..f8f5768 100644
--- a/world.h
+++ b/world.h
@@ -18,6 +18,7 @@ typedef struct World {
int deathzone_count;
Player player;
Map map;
+ int frame;
} World;
void init_world(World* w);