From 1ac83c4fc1d3ae63d29ae67b2569ebbb4126d154 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sat, 15 Jul 2023 16:28:05 +0100 Subject: Prevent death when the stage is complete --- src/game.c | 5 +++++ src/game.h | 1 + src/player.c | 3 +++ 3 files changed, 9 insertions(+) (limited to 'src') 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; -- cgit v1.2.3