summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2024-05-17 22:48:25 +0200
committerAldrik Ramaekers <aldrikboy@gmail.com>2024-05-17 22:48:25 +0200
commit003c13a4ae07c3ec15a31df0f7f65e3d1ffe9ae0 (patch)
treea56b0e1d84d297c5869e8272fcac58c298a51ed5 /include
parentf06351b8a04d0a68628b05bed884832840998c6c (diff)
game fade in and out
Diffstat (limited to 'include')
-rw-r--r--include/asset_defs.h1
-rw-r--r--include/game.h3
-rw-r--r--include/protocol.h1
-rw-r--r--include/rounds.h5
4 files changed, 8 insertions, 2 deletions
diff --git a/include/asset_defs.h b/include/asset_defs.h
index 8379656..8249177 100644
--- a/include/asset_defs.h
+++ b/include/asset_defs.h
@@ -33,6 +33,7 @@ font* fnt_4;
// UI
image* img_red_border;
image* img_heart;
+image* img_skull;
image* img_hurt_overlay_left;
image* img_hurt_overlay_right;
image* img_stats_overlay;
diff --git a/include/game.h b/include/game.h
index 2884a92..91f471d 100644
--- a/include/game.h
+++ b/include/game.h
@@ -39,12 +39,13 @@ typedef struct t_game {
scene_state global_scene_state = SCENE_MAIN_MENU;
game global_state = {GAMESTATE_IDLE,DISCONNECTED,0,0};
-bool game_is_paused = false;
+extern bool game_is_paused;
pathfinding_request active_requests[SERVER_PATHFINDING_THREADS] = {0};
void init_game();
void start_solo_game();
bool connect_to_game(char* ip, char* port);
void fill_game_structs();
+bool every_player_died();
#endif \ No newline at end of file
diff --git a/include/protocol.h b/include/protocol.h
index d89952c..001e601 100644
--- a/include/protocol.h
+++ b/include/protocol.h
@@ -95,6 +95,7 @@ typedef struct t_protocol_round
{
network_message_type type;
zombie_round round;
+ bool game_is_paused;
} protocol_round;
typedef enum t_protocol_move_type
diff --git a/include/rounds.h b/include/rounds.h
index e13f58d..2a93f30 100644
--- a/include/rounds.h
+++ b/include/rounds.h
@@ -10,14 +10,17 @@ typedef enum t_round_state {
ROUND_SWITCHING,
} round_state;
+#define FADE_IN_DURATION 3.0f
+
typedef struct t_zombie_round {
u32 round_nr;
u32 zombies;
round_state state;
float round_timer;
+ float fade_in_timer;
} zombie_round;
-zombie_round _current_round = {.round_nr = 12, .zombies = 0, .state = ROUND_SWITCHING};
+zombie_round _current_round = {.round_nr = 0, .zombies = 0, .state = ROUND_SWITCHING, 3.0f};
bool current_round_is_done();
void start_next_round();