diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-07-15 16:28:05 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-07-15 16:28:05 +0100 |
commit | 1ac83c4fc1d3ae63d29ae67b2569ebbb4126d154 (patch) | |
tree | d9744f23b41b54d8a81f7e1f585727217c007e0d | |
parent | ab1e055e35bf8b1dbaf2ed15f7404b525f016b3c (diff) | |
download | gold-mine-run-1ac83c4fc1d3ae63d29ae67b2569ebbb4126d154.tar.gz gold-mine-run-1ac83c4fc1d3ae63d29ae67b2569ebbb4126d154.zip |
Prevent death when the stage is complete
-rw-r--r-- | src/game.c | 5 | ||||
-rw-r--r-- | src/game.h | 1 | ||||
-rw-r--r-- | src/player.c | 3 |
3 files changed, 9 insertions, 0 deletions
@@ -422,3 +422,8 @@ uint8_t use_pickaxe() } return 0; } + +uint8_t is_stageclear() +{ + return stageclear; +} @@ -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; |