aboutsummaryrefslogtreecommitdiff
path: root/src/game.c
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-07-11 22:09:18 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-07-11 22:09:18 +0100
commitd8d566ddfc9535dd773d942c7e874b875cd803b4 (patch)
tree987779ae55454d2db9f98ca7c80160c9ef617450 /src/game.c
parent26ab42af5d43c641237a59ca12c97143c5fb571b (diff)
downloadgold-mine-run-d8d566ddfc9535dd773d942c7e874b875cd803b4.tar.gz
gold-mine-run-d8d566ddfc9535dd773d942c7e874b875cd803b4.zip
Multiple stages
Diffstat (limited to 'src/game.c')
-rw-r--r--src/game.c14
1 files changed, 13 insertions, 1 deletions
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;
}
}