aboutsummaryrefslogtreecommitdiff
path: root/src/player.c
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-06-29 21:47:55 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-06-29 21:47:55 +0100
commit2d2379251e71b5f315235db7980d0cfe03132561 (patch)
tree346ddd8719753fa1470cb8dc7456328d033ebff1 /src/player.c
parent16fb9f0d5e5904cca7c256b63f20f1fc1466bd5e (diff)
downloadgold-mine-run-2d2379251e71b5f315235db7980d0cfe03132561.tar.gz
gold-mine-run-2d2379251e71b5f315235db7980d0cfe03132561.zip
Add pickaxe pickup
Diffstat (limited to 'src/player.c')
-rw-r--r--src/player.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/player.c b/src/player.c
index ae50348..71c951a 100644
--- a/src/player.c
+++ b/src/player.c
@@ -309,8 +309,12 @@ uint8_t player_collision(Entity *e)
void player_hit()
{
- /* TODO: pickaxe */
- dying = 1;
- frame = FRAME_DYING;
- gravity = GRAVITY_UP;
+ if (use_pickaxe())
+ invuln = INVULN_TIME;
+ else
+ {
+ dying = 1;
+ frame = FRAME_DYING;
+ gravity = GRAVITY_UP;
+ }
}