blob: 5bc7abe0763ddd596ed8aefa720e2e82e51ef932 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
#ifndef GAME_H
#define GAME_H
#include "types.h"
#include "input.h"
#include "sprite.h"
#include "level.h"
#include "ball.h"
#include "particle.h"
#include "post_processor.h"
#include "powerup.h"
#include "text.h"
enum game_state {
game_active,
game_menu,
game_win
};
#define max_powerups 4
#define max_levels 4
struct game {
enum game_state state;
i32 running;
struct input input;
i32 width, height;
const char *bindir;
struct sprite_renderer renderer;
struct level levels[max_levels];
i32 level;
struct object player;
u32 lives;
struct ball ball;
struct particle_generator generator;
struct post_processor post_processor;
f32 time;
f32 shake_time;
struct powerup powerups[max_powerups];
struct text_renderer text_renderer;
};
struct game init_game(i32 width, i32 height);
void process_input(struct game *game);
void update_game(struct game *game, f32 dt);
void render_game(struct game game);
#endif
|