From ee655819d44307d974fb27e1fa04d079a3810d63 Mon Sep 17 00:00:00 2001 From: quou Date: Mon, 30 Sep 2024 22:13:31 +1000 Subject: enemy --- world.h | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'world.h') diff --git a/world.h b/world.h index bd3df31..14e2447 100644 --- a/world.h +++ b/world.h @@ -5,12 +5,17 @@ #include "obj.h" #define max_particles 32 +#define max_enemies 16 +#define max_deathzones 16 struct Renderer; typedef struct World { Particle particles[max_particles]; - int particle_count; + Enemy enemies[max_enemies]; + Deathzone deathzones[max_deathzones]; + int particle_count, enemy_count; + int deathzone_count; Player player; Map map; } World; @@ -23,7 +28,22 @@ Particle* inst_particle( int anim, int bmp ); -void update_world(World* w, const App* a); +Enemy* inst_enemy( + World* w, + Enemy_Type t, + int x, + int y +); +Deathzone* inst_deathzone( + World* w, + const Rect* r, + int vx, + int vy, + int hp, + int life, + int friendly +); +void update_world(World* w, const struct App* a); void ren_world(const World* w, struct Renderer* r); #endif -- cgit v1.2.3-54-g00ecf