#ifndef game_h #define game_h #include "world.h" #include "menu.h" typedef enum { game_state_menu = 0, game_state_game, game_state_credits, game_state_dead } Game_State; typedef struct Game Game; typedef struct { void (*state_init)(Game* game); void (*state_update)(Game* game); void (*state_deinit)(Game* game); } Game_State_Fns; struct Game { const Game_State_Fns* fns; Game_State state; Menu menu; World world; int wave_timer, want_next, display_wave_text; }; void game_init(Game* game, Game_State state); void game_update(Game* game); void game_deinit(Game* game); void game_change_state(Game* game, Game_State state); void gameplay_next_wave(Game* menu); void gameplay_new(Game* game); #endif