Overworld zene
This commit is contained in:
@@ -8,6 +8,9 @@ from objects import BalthasarRenderer, OverworldMap, BattlePodium, DIR_UP, DIR_L
|
|||||||
|
|
||||||
WALK_SPEED = 48
|
WALK_SPEED = 48
|
||||||
|
|
||||||
|
OVERWORLD_MUSIC = "mus_fnafsux"
|
||||||
|
music_box = None
|
||||||
|
|
||||||
balthasar = BalthasarRenderer(96,16)
|
balthasar = BalthasarRenderer(96,16)
|
||||||
overworld = OverworldMap()
|
overworld = OverworldMap()
|
||||||
objects = [
|
objects = [
|
||||||
@@ -18,6 +21,7 @@ objects = [
|
|||||||
balthasar
|
balthasar
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
btrans_active = False
|
btrans_active = False
|
||||||
btrans_timer = 0
|
btrans_timer = 0
|
||||||
btrans_sound = None
|
btrans_sound = None
|
||||||
@@ -81,13 +85,19 @@ def get_feet_aabb(world_x, world_y, width, height):
|
|||||||
def start_battle(battle_id):
|
def start_battle(battle_id):
|
||||||
global btrans_active, btrans_timer, btrans_sound
|
global btrans_active, btrans_timer, btrans_sound
|
||||||
gamestate.gamestates["battle"].battle_id = battle_id
|
gamestate.gamestates["battle"].battle_id = battle_id
|
||||||
|
music_box.pause()
|
||||||
btrans_sound = assets.sounds["sfx_encounter"].play()
|
btrans_sound = assets.sounds["sfx_encounter"].play()
|
||||||
btrans_active = True
|
btrans_active = True
|
||||||
btrans_timer = 0
|
btrans_timer = 0
|
||||||
|
|
||||||
def switch(game):
|
def switch(game):
|
||||||
|
global music_box
|
||||||
in_battle_transition = False
|
in_battle_transition = False
|
||||||
overworld.set_player_world_pos(game, balthasar.x, balthasar.y)
|
overworld.set_player_world_pos(game, balthasar.x, balthasar.y)
|
||||||
|
if music_box:
|
||||||
|
music_box.unpause()
|
||||||
|
else:
|
||||||
|
music_box = assets.sounds[OVERWORLD_MUSIC].play(loops=True)
|
||||||
|
|
||||||
# !!! CHATGPT !!!
|
# !!! CHATGPT !!!
|
||||||
def update(game, dt):
|
def update(game, dt):
|
||||||
|
|||||||
Reference in New Issue
Block a user