diff options
author | quou <quou@disroot.org> | 2023-05-07 09:37:45 +1000 |
---|---|---|
committer | quou <quou@disroot.org> | 2023-05-07 09:37:45 +1000 |
commit | 40eb179043b77f011fb1048c386ee187f64569d0 (patch) | |
tree | ebae794ec0b3b8851b8c29119ada06555f49d4b6 /wave.h | |
parent | 47e7976922f5c17505c7c5a3377c3735649e3dcc (diff) |
Add waves and some more polish.
Diffstat (limited to 'wave.h')
-rw-r--r-- | wave.h | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -0,0 +1,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 |