aboutsummaryrefslogtreecommitdiff
path: root/src/player.c
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-07-03 21:40:42 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-07-03 21:40:42 +0100
commit4ef8cf8b3d9ad5235aa858a68f70a8aaf2b356da (patch)
tree5e84fc575df54a29097c9356ccc2e39988990dfd /src/player.c
parenta225a6cf64b4c011fea851acb7dd424a1e957655 (diff)
downloadgold-mine-run-4ef8cf8b3d9ad5235aa858a68f70a8aaf2b356da.tar.gz
gold-mine-run-4ef8cf8b3d9ad5235aa858a68f70a8aaf2b356da.zip
Sound queue
This is to queue sounds and play them when we update the screen, so the sounds are synced with the action. It is required because the MikMod_Update function updates on the clock int, and is not synced with the VGA's vsync.
Diffstat (limited to 'src/player.c')
-rw-r--r--src/player.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/player.c b/src/player.c
index 8d80923..c07cc34 100644
--- a/src/player.c
+++ b/src/player.c
@@ -165,7 +165,7 @@ void player_update()
momentum = 0;
frame = FRAME_JUMPING;
gravity = GRAVITY_UP;
- sound_play_efx(EFX_JUMP);
+ sound_queue_efx(EFX_JUMP);
}
}
else
@@ -278,7 +278,7 @@ void player_update()
if (map_update_gold(x + (dir == DIR_LEFT ? 7 : 8), y + 15))
{
add_score(10);
- sound_play_efx(EFX_GOLD);
+ sound_queue_efx(EFX_GOLD);
}
}
@@ -325,13 +325,13 @@ void player_hit()
if (use_pickaxe())
{
invuln = INVULN_TIME;
- sound_play_efx(EFX_HIT);
+ sound_queue_efx(EFX_HIT);
}
else
{
dying = 1;
frame = FRAME_DYING;
gravity = GRAVITY_UP;
- sound_play_efx(EFX_DEATH);
+ sound_queue_efx(EFX_DEATH);
}
}