Csatakezdés hang
This commit is contained in:
BIN
res/sfx/encounter.wav
Normal file
BIN
res/sfx/encounter.wav
Normal file
Binary file not shown.
@@ -12,5 +12,6 @@ sprites = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sounds = {
|
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")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import assets
|
||||||
import arcade
|
import arcade
|
||||||
import controls
|
import controls
|
||||||
import gamestate
|
import gamestate
|
||||||
@@ -12,12 +13,14 @@ overworld = OverworldMap()
|
|||||||
|
|
||||||
btrans_active = False
|
btrans_active = False
|
||||||
btrans_timer = 0
|
btrans_timer = 0
|
||||||
|
btrans_sound = None
|
||||||
BTRANS_PULSE_DUR = 0.25
|
BTRANS_PULSE_DUR = 0.25
|
||||||
BTRANS_DURATION = 0.75
|
BTRANS_DURATION = 0.75
|
||||||
|
|
||||||
def start_battle(battle_id):
|
def start_battle(battle_id):
|
||||||
global btrans_active, btrans_timer
|
global btrans_active, btrans_timer, btrans_sound
|
||||||
gamestate.gamestates["battle"].battle_id = battle_id
|
gamestate.gamestates["battle"].battle_id = battle_id
|
||||||
|
btrans_sound = assets.sounds["sfx_encounter"].play()
|
||||||
btrans_active = True
|
btrans_active = True
|
||||||
btrans_timer = 0
|
btrans_timer = 0
|
||||||
|
|
||||||
@@ -31,6 +34,7 @@ def update(game, dt):
|
|||||||
|
|
||||||
if btrans_timer >= BTRANS_DURATION:
|
if btrans_timer >= BTRANS_DURATION:
|
||||||
game.mos_enabled = False
|
game.mos_enabled = False
|
||||||
|
btrans_sound.stop()
|
||||||
gamestate.switch_gamestate(game,"battle")
|
gamestate.switch_gamestate(game,"battle")
|
||||||
|
|
||||||
game.mos_enabled = True
|
game.mos_enabled = True
|
||||||
|
|||||||
Reference in New Issue
Block a user