diff --git a/res/sfx/encounter.wav b/res/sfx/encounter.wav new file mode 100644 index 0000000..e862dc0 Binary files /dev/null and b/res/sfx/encounter.wav differ diff --git a/src/assets.py b/src/assets.py index 1e6c824..df659e8 100644 --- a/src/assets.py +++ b/src/assets.py @@ -12,5 +12,6 @@ sprites = { } sounds = { - "mus_fnafsux": pygame.mixer.Sound("res/mus/fnafsux.wav") + "mus_fnafsux": pygame.mixer.Sound("res/mus/fnafsux.wav"), + "sfx_encounter": pygame.mixer.Sound("res/sfx/encounter.wav") } diff --git a/src/gamestates/overworld.py b/src/gamestates/overworld.py index d9b7ffe..42109a0 100644 --- a/src/gamestates/overworld.py +++ b/src/gamestates/overworld.py @@ -1,3 +1,4 @@ +import assets import arcade import controls import gamestate @@ -12,12 +13,14 @@ overworld = OverworldMap() btrans_active = False btrans_timer = 0 +btrans_sound = None BTRANS_PULSE_DUR = 0.25 BTRANS_DURATION = 0.75 def start_battle(battle_id): - global btrans_active, btrans_timer + global btrans_active, btrans_timer, btrans_sound gamestate.gamestates["battle"].battle_id = battle_id + btrans_sound = assets.sounds["sfx_encounter"].play() btrans_active = True btrans_timer = 0 @@ -31,6 +34,7 @@ def update(game, dt): if btrans_timer >= BTRANS_DURATION: game.mos_enabled = False + btrans_sound.stop() gamestate.switch_gamestate(game,"battle") game.mos_enabled = True