]> git.lizzy.rs Git - nothing.git/blob - src/game.h
Remove Grid and ActionPicker
[nothing.git] / src / game.h
1 #ifndef GAME_H_
2 #define GAME_H_
3
4 #include <SDL.h>
5
6 #include "game/sound_samples.h"
7
8 typedef struct Game Game;
9
10 Game *create_game(const char *platforms_file_path,
11                     const char *sound_sample_files[],
12                     size_t sound_sample_files_count,
13                     SDL_Renderer *renderer);
14 void destroy_game(Game *game);
15
16 int game_render(const Game *game);
17 int game_sound(Game *game);
18 int game_update(Game *game, float delta_time);
19
20 int game_event(Game *game, const SDL_Event *event);
21 int game_input(Game *game,
22                const Uint8 *const keyboard_state,
23                SDL_Joystick *the_stick_of_joy);
24
25 int game_over_check(const Game *game);
26
27 typedef enum Game_state {
28     GAME_STATE_LEVEL = 0,
29     GAME_STATE_LEVEL_PICKER,
30     GAME_STATE_LEVEL_EDITOR,
31     GAME_STATE_CREDITS,
32     GAME_STATE_SETTINGS,
33     GAME_STATE_QUIT
34 } Game_state;
35
36 void game_switch_state(Game *game, Game_state state);
37 int game_load_level(Game *game, const char *filepath);
38
39 // defined in main.c. is there a better place for this to be declared?
40 float get_display_scale(void);
41
42 #endif  // GAME_H_