aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-07-15 16:28:05 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-07-15 16:28:05 +0100
commit1ac83c4fc1d3ae63d29ae67b2569ebbb4126d154 (patch)
treed9744f23b41b54d8a81f7e1f585727217c007e0d /src
parentab1e055e35bf8b1dbaf2ed15f7404b525f016b3c (diff)
downloadgold-mine-run-1ac83c4fc1d3ae63d29ae67b2569ebbb4126d154.tar.gz
gold-mine-run-1ac83c4fc1d3ae63d29ae67b2569ebbb4126d154.zip
Prevent death when the stage is complete
Diffstat (limited to 'src')
-rw-r--r--src/game.c5
-rw-r--r--src/game.h1
-rw-r--r--src/player.c3
3 files changed, 9 insertions, 0 deletions
diff --git a/src/game.c b/src/game.c
index c8601be..2c58107 100644
--- a/src/game.c
+++ b/src/game.c
@@ -422,3 +422,8 @@ uint8_t use_pickaxe()
}
return 0;
}
+
+uint8_t is_stageclear()
+{
+ return stageclear;
+}
diff --git a/src/game.h b/src/game.h
index ea01495..f3466fc 100644
--- a/src/game.h
+++ b/src/game.h
@@ -9,5 +9,6 @@ uint8_t dec_lives();
void reset_time();
void add_pickaxe();
uint8_t use_pickaxe();
+uint8_t is_stageclear();
#endif /* _GAME_H */
diff --git a/src/player.c b/src/player.c
index cf8978c..15e7c8e 100644
--- a/src/player.c
+++ b/src/player.c
@@ -327,6 +327,9 @@ uint8_t player_collision_pickup(Entity *e)
void player_hit()
{
+ if (is_stageclear())
+ return;
+
if (use_pickaxe())
{
invuln = INVULN_TIME;