Merge pull request #511 from KirbyKid256/pulls/misc-bugfixes-from-multiplayer-branch

Miscellaneous Bugfixes From My Multiplayer Branch
This commit is contained in:
guzlad
2025-10-06 13:28:23 +02:00
committed by GitHub
9 changed files with 20 additions and 23 deletions

View File

@@ -11,11 +11,9 @@ signal sprites_updated
static var cache := {}
func _enter_tree() -> void:
func _ready() -> void:
Global.level_theme_changed.connect(update_sprites)
Global.level_time_changed.connect(update_sprites)
func _ready() -> void:
update_sprites()
func update_sprites() -> void:

View File

@@ -36,17 +36,18 @@ var update_on_spawn := true
func _init() -> void:
set_process_mode(Node.PROCESS_MODE_ALWAYS)
func _ready() -> void:
Global.level_time_changed.connect(update_resource)
Global.level_theme_changed.connect(update_resource)
func _enter_tree() -> void:
safety_check()
if update_on_spawn:
update_resource()
Global.level_time_changed.connect(update_resource)
Global.level_theme_changed.connect(update_resource)
func safety_check() -> void:
if Settings.file.visuals.resource_packs.has("BaseAssets") == false:
Settings.file.visuals.resource_packs.append("BaseAssets")
if Settings.file.visuals.resource_packs.has(Global.ROM_PACK_NAME) == false:
Settings.file.visuals.resource_packs.insert(Global.ROM_PACK_NAME, 0)
func update_resource() -> void:
randomize()

View File

@@ -425,7 +425,7 @@ func add_stomp_combo(award_score := true) -> void:
score_note_spawner.spawn_note(10000)
else:
Global.lives += 1
AudioManager.play_global_sfx("1_up")
AudioManager.play_sfx("1_up", global_position)
score_note_spawner.spawn_one_up_note()
else:
if award_score:
@@ -564,8 +564,6 @@ func die(pit := false) -> void:
visible = not pit
flight_meter = 0
dead.emit()
Global.p_switch_active = false
Global.p_switch_timer = 0
stop_all_timers()
Global.total_deaths += 1
sprite.process_mode = Node.PROCESS_MODE_ALWAYS
@@ -804,8 +802,6 @@ func jump() -> void:
gravity = JUMP_GRAVITY
AudioManager.play_sfx("small_jump" if power_state.hitbox_size == "Small" else "big_jump", global_position)
has_jumped = true
await get_tree().physics_frame
has_jumped = true
func calculate_jump_height() -> float: # Thanks wye love you xxx
return -(JUMP_HEIGHT + JUMP_INCR * int(abs(velocity.x) / 25))

View File

@@ -123,6 +123,7 @@ func update_theme() -> void:
Global.level_theme = theme
Global.theme_time = theme_time
TitleScreen.last_theme = theme
if get_node_or_null("LevelBG") != null:
$LevelBG.update_visuals()
func update_next_level_info() -> void:

View File

@@ -5,6 +5,7 @@ const DEFAULT_SFX_LIBRARY := {
"big_jump": ("res://Assets/Audio/SFX/BigJump.wav"),
"coin": ("res://Assets/Audio/SFX/Coin.wav"),
"bump": ("res://Assets/Audio/SFX/Bump.wav"),
"skid": ("res://Assets/Audio/SFX/Skid.wav"),
"pipe": ("res://Assets/Audio/SFX/Pipe.wav"),
"damage": ("res://Assets/Audio/SFX/Damage.wav"),
"power_up": ("res://Assets/Audio/SFX/Powerup.wav"),

View File

@@ -327,6 +327,8 @@ func reset_values() -> void:
Level.in_vine_level = false
Level.vine_return_level = ""
Level.vine_warp_level = ""
p_switch_active = false
p_switch_timer = 0.0
func clear_saved_values() -> void:
coins = 0

View File

@@ -12,9 +12,9 @@ var file := {
"frame_limit" : 0,
},
"audio": {
"master": 10.0,
"music": 10.0,
"sfx": 10.0,
"master": 10,
"music": 10,
"sfx": 10,
"athletic_bgm": 1,
"extra_bgm": 1,
"skid_sfx": 1,
@@ -24,8 +24,7 @@ var file := {
},
"game": {
"campaign": "SMB1",
"lang": "en",
"character": "0000"
"lang": "en"
},
"keyboard":
{

View File

@@ -27,4 +27,4 @@ func go_to_level() -> void:
Global.transition_to_scene(LevelTransition.level_to_transition_to)
func play_pipe_sfx() -> void:
AudioManager.play_global_sfx("pipe")
AudioManager.play_sfx("pipe", $Player1.global_position)

View File

@@ -48,7 +48,7 @@ func open() -> void:
AudioManager.play_global_sfx("pause")
get_tree().paused = true
show()
await get_tree().physics_frame
await get_tree().create_timer(0.1).timeout
active = true
func close() -> void:
@@ -56,7 +56,6 @@ func close() -> void:
selected_index = 0
hide()
closed.emit()
for i in 2:
await get_tree().physics_frame
await get_tree().create_timer(0.1).timeout
Global.game_paused = false
get_tree().paused = false