aboutsummaryrefslogtreecommitdiff
path: root/game.h
blob: 590cc56af0252c3a81100feeda9924ed79a9b778 (plain) (blame)
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
#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