diff options
author | pryazha <pryadeiniv@mail.ru> | 2025-08-16 10:11:00 +0500 |
---|---|---|
committer | pryazha <pryadeiniv@mail.ru> | 2025-08-16 10:11:00 +0500 |
commit | 1f93c3ef62af6c71217f06491ca2b859d4065740 (patch) | |
tree | 4f07192788df29446aa1ddb73a20839e4ddf9b3f /in_practice/breakout/game.h | |
parent | 99337878eca2807436bcf11d36946b90db44a2d3 (diff) |
in practice chapter
Diffstat (limited to 'in_practice/breakout/game.h')
-rw-r--r-- | in_practice/breakout/game.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/in_practice/breakout/game.h b/in_practice/breakout/game.h new file mode 100644 index 0000000..31f5dcd --- /dev/null +++ b/in_practice/breakout/game.h @@ -0,0 +1,33 @@ +#ifndef GAME_H +#define GAME_H + +#include "types.h" +#include "input.h" +#include "sprite.h" +#include "level.h" +#include "ball.h" + +typedef enum { + game_active, + game_menu, + game_win +} game_state_enum; + +typedef struct { + game_state_enum state; + i32 running; + input_t input; + i32 width, height; + const char *bindir; + sprite_renderer_t renderer; + level_t level; + object_t player; + ball_t ball; +} game_t; + +extern game_t init_game(i32 width, i32 height); +extern void process_input(game_t *game); +extern void update_game(game_t *game, f32 dt); +extern void render_game(game_t game); + +#endif |