aboutsummaryrefslogtreecommitdiff
path: root/game.h
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-10-05 12:13:47 +1000
committerquou <quou@disroot.org>2024-10-05 12:13:47 +1000
commit0e75a2949678cb8a68fb0819355864aa6db2cb43 (patch)
treeabeb4ecb53649e520e4fcc1652ad870e3d7175fa /game.h
parent6cab1d56ad2b29a2556090f1f0ce7e2b72d5460a (diff)
Level transitions and main menu
Diffstat (limited to 'game.h')
-rw-r--r--game.h35
1 files changed, 35 insertions, 0 deletions
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