summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik@amftech.nl>2023-11-05 11:08:16 +0100
committerAldrik Ramaekers <aldrik@amftech.nl>2023-11-05 11:08:16 +0100
commit075335d187f45de7d002e3f44f6ec93b30abed78 (patch)
tree0326b8ef2b4b779f4a1eee10a62b1a803c6e19ba /include
parent2b23a7efd6cc4d55e10e01c978a3614e7b97c93c (diff)
rounds
Diffstat (limited to 'include')
-rw-r--r--include/rounds.h27
-rw-r--r--include/zombie_chunk.h2
-rw-r--r--include/zombies.h1
3 files changed, 29 insertions, 1 deletions
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 <projectbase/project_base.h>
+
+#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