From 0e75a2949678cb8a68fb0819355864aa6db2cb43 Mon Sep 17 00:00:00 2001 From: quou Date: Sat, 5 Oct 2024 12:13:47 +1000 Subject: Level transitions and main menu --- game.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 game.h (limited to 'game.h') diff --git a/game.h b/game.h new file mode 100644 index 0000000..590cc56 --- /dev/null +++ b/game.h @@ -0,0 +1,35 @@ +#ifndef game_h +#define game_h + +#include "world.h" + +struct Renderer; +struct App; + +#define game_max_state_queue 8 + +typedef enum { + game_state_menu, + game_state_play, + game_state_generate, + game_state_fade_in, + game_state_fade_out, + game_state_over +} Game_State; + +typedef struct { + World w; + Game_State st, ps; + Game_State sq[game_max_state_queue]; + Rect fr; + int want_next; + int qt, frame, ff; +} Game; + +void init_game(Game* g, Game_State s); +void update_game(Game* g, struct App* a); +void ren_game(const Game* g, struct Renderer* r); +void queue_gs(Game* g, Game_State s); +void next_gs(Game* g); + +#endif -- cgit v1.2.3-54-g00ecf