aboutsummaryrefslogtreecommitdiff
path: root/game.h
blob: b39ef53a63f4bcff59e8135240b08e169fd4bb81 (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
36
37
38
39
40
41
42
43
44
#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_intro,
	game_state_outro,
	game_state_compute_ec,
	game_state_generate,
	game_state_generate_intro,
	game_state_generate_outro,
	game_state_restart,
	game_state_reset,
	game_state_restore_player,
	game_state_next,
	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, me, kills, cfloor;
	int qt, frame, ff, hp, ch;
} 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