From a88810c8a70c8e3a7533a266774ab61a84a9adf4 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sun, 2 Jul 2023 21:31:19 +0100 Subject: Add sound support --- src/player.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/player.c') 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); } } -- cgit v1.2.3