aboutsummaryrefslogtreecommitdiff
path: root/wave.h
blob: 3d4098125f92316f38e45d9cd08309cbeb1a63d3 (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
#ifndef wave_h
#define wave_h

#include "config.h"

/* TODO: Different enemies. */

typedef struct Waver Waver;

typedef void (*Wave_Finish)(Waver* waver, int last);

typedef struct {
	int x, y;
} Wave_Spawn;

typedef struct {
	int frame;
	int count;
	Wave_Spawn spawns[wave_max_spawns];
} Subwave;

typedef struct {
	Subwave subwaves[wave_max_subwaves];
	int subwave_count;
} Wave;

struct Waver {
	int idx, sidx;
	int timer;
};

void init_waver(Waver* waver);
void next_wave(Waver* waver);
void update_waver(Waver* waver, struct World* world);

#endif