From d8d566ddfc9535dd773d942c7e874b875cd803b4 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Tue, 11 Jul 2023 22:09:18 +0100 Subject: Multiple stages --- src/game.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/game.c') diff --git a/src/game.c b/src/game.c index 7d64224..85fb050 100644 --- a/src/game.c +++ b/src/game.c @@ -48,6 +48,12 @@ static uint8_t gameover; static uint8_t pause; static Entity *tmonster; +#define STAGES_LEN 2 + +static const uint8_t *stages[STAGES_LEN] = { + binary_stage01_start, binary_stage02_start, +}; + static void hud_render() { char b[32]; @@ -175,7 +181,7 @@ next_stage: blit_target(TARGET_BUFFER); blit_erase(0); - map_init(binary_stage_start); + map_init(stages[stage]); map_render(); hud_render(); @@ -246,6 +252,12 @@ next_stage: if (stageclear == 1) { run_stageclear(); + stage++; + if (stage == STAGES_LEN) + { + /* TODO: endgame */ + break; + } goto next_stage; } } -- cgit v1.2.3