aboutsummaryrefslogtreecommitdiff
path: root/src/player.c
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-07-02 21:31:19 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-07-02 21:31:19 +0100
commita88810c8a70c8e3a7533a266774ab61a84a9adf4 (patch)
tree9ec78cd5e20f06a6cbcbd0251e215f2ecaae71c4 /src/player.c
parent6e03fe85b19bc533888a4689572aab0ccf68edc4 (diff)
downloadgold-mine-run-a88810c8a70c8e3a7533a266774ab61a84a9adf4.tar.gz
gold-mine-run-a88810c8a70c8e3a7533a266774ab61a84a9adf4.zip
Add sound support
Diffstat (limited to 'src/player.c')
-rw-r--r--src/player.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/player.c b/src/player.c
index a8a75cf..8d80923 100644
--- a/src/player.c
+++ b/src/player.c
@@ -2,6 +2,7 @@
#include "keyb.h"
#include "vga.h"
+#include "sound.h"
#include "map.h"
#include "data.h"
#include "game.h"
@@ -164,6 +165,7 @@ void player_update()
momentum = 0;
frame = FRAME_JUMPING;
gravity = GRAVITY_UP;
+ sound_play_efx(EFX_JUMP);
}
}
else
@@ -274,7 +276,10 @@ void player_update()
}
if (map_update_gold(x + (dir == DIR_LEFT ? 7 : 8), y + 15))
+ {
add_score(10);
+ sound_play_efx(EFX_GOLD);
+ }
}
void player_erase()
@@ -318,11 +323,15 @@ uint8_t player_collision_pickup(Entity *e)
void player_hit()
{
if (use_pickaxe())
+ {
invuln = INVULN_TIME;
+ sound_play_efx(EFX_HIT);
+ }
else
{
dying = 1;
frame = FRAME_DYING;
gravity = GRAVITY_UP;
+ sound_play_efx(EFX_DEATH);
}
}