From 075335d187f45de7d002e3f44f6ec93b30abed78 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sun, 5 Nov 2023 11:08:16 +0100 Subject: rounds --- include/rounds.h | 27 +++++++++++++++++++++++++++ include/zombie_chunk.h | 2 +- include/zombies.h | 1 + 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 include/rounds.h (limited to 'include') diff --git a/include/rounds.h b/include/rounds.h new file mode 100644 index 0000000..832cc1d --- /dev/null +++ b/include/rounds.h @@ -0,0 +1,27 @@ +#ifndef INCLUDE_ROUNDS +#define INCLUDE_ROUNDS + +#include + +#define ROUND_SWITCH_TIME 6.0f + +typedef enum t_round_state { + ROUND_SPAWNING, + ROUND_SWITCHING, +} round_state; + +typedef struct t_zombie_round { + u32 round_nr; + u32 zombies; + round_state state; + float round_timer; +} zombie_round; + +zombie_round _current_round = {.round_nr = 0, .zombies = 0, .state = ROUND_SWITCHING}; + +bool current_round_is_done(); +void start_next_round(); +int zombies_left_in_current_round(); +void update_round_server(); + +#endif \ No newline at end of file diff --git a/include/zombie_chunk.h b/include/zombie_chunk.h index d774026..7beb14c 100644 --- a/include/zombie_chunk.h +++ b/include/zombie_chunk.h @@ -35,6 +35,6 @@ zombie_chunk zombie_chunks[MAX_ZOMBIE_CHUNKS] = {0}; void draw_zombie_chunks(platform_window* window); void spawn_zombie_chunk(vec3f center); void spawn_zombie_splatter(vec3f center); -void update_zombie_chunks(); +void update_zombie_chunks_server(); #endif \ No newline at end of file diff --git a/include/zombies.h b/include/zombies.h index b2aeb2a..9c1b68d 100644 --- a/include/zombies.h +++ b/include/zombies.h @@ -44,5 +44,6 @@ void create_spawner(vec2 position); void draw_spawners(platform_window* window); void draw_zombies(platform_window* window); void spawn_zombie(int x, int y); +u32 number_of_zombies_active(); #endif \ No newline at end of file -- cgit v1.2.3-70-g09d2