mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 15:38:14 +00:00
Merge pull request #511 from KirbyKid256/pulls/misc-bugfixes-from-multiplayer-branch
Miscellaneous Bugfixes From My Multiplayer Branch
This commit is contained in:
@@ -11,11 +11,9 @@ signal sprites_updated
|
|||||||
|
|
||||||
static var cache := {}
|
static var cache := {}
|
||||||
|
|
||||||
func _enter_tree() -> void:
|
func _ready() -> void:
|
||||||
Global.level_theme_changed.connect(update_sprites)
|
Global.level_theme_changed.connect(update_sprites)
|
||||||
Global.level_time_changed.connect(update_sprites)
|
Global.level_time_changed.connect(update_sprites)
|
||||||
|
|
||||||
func _ready() -> void:
|
|
||||||
update_sprites()
|
update_sprites()
|
||||||
|
|
||||||
func update_sprites() -> void:
|
func update_sprites() -> void:
|
||||||
|
@@ -36,17 +36,18 @@ var update_on_spawn := true
|
|||||||
func _init() -> void:
|
func _init() -> void:
|
||||||
set_process_mode(Node.PROCESS_MODE_ALWAYS)
|
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:
|
func _enter_tree() -> void:
|
||||||
safety_check()
|
safety_check()
|
||||||
if update_on_spawn:
|
if update_on_spawn:
|
||||||
update_resource()
|
update_resource()
|
||||||
Global.level_time_changed.connect(update_resource)
|
|
||||||
Global.level_theme_changed.connect(update_resource)
|
|
||||||
|
|
||||||
|
|
||||||
func safety_check() -> void:
|
func safety_check() -> void:
|
||||||
if Settings.file.visuals.resource_packs.has("BaseAssets") == false:
|
if Settings.file.visuals.resource_packs.has(Global.ROM_PACK_NAME) == false:
|
||||||
Settings.file.visuals.resource_packs.append("BaseAssets")
|
Settings.file.visuals.resource_packs.insert(Global.ROM_PACK_NAME, 0)
|
||||||
|
|
||||||
func update_resource() -> void:
|
func update_resource() -> void:
|
||||||
randomize()
|
randomize()
|
||||||
|
@@ -425,7 +425,7 @@ func add_stomp_combo(award_score := true) -> void:
|
|||||||
score_note_spawner.spawn_note(10000)
|
score_note_spawner.spawn_note(10000)
|
||||||
else:
|
else:
|
||||||
Global.lives += 1
|
Global.lives += 1
|
||||||
AudioManager.play_global_sfx("1_up")
|
AudioManager.play_sfx("1_up", global_position)
|
||||||
score_note_spawner.spawn_one_up_note()
|
score_note_spawner.spawn_one_up_note()
|
||||||
else:
|
else:
|
||||||
if award_score:
|
if award_score:
|
||||||
@@ -564,8 +564,6 @@ func die(pit := false) -> void:
|
|||||||
visible = not pit
|
visible = not pit
|
||||||
flight_meter = 0
|
flight_meter = 0
|
||||||
dead.emit()
|
dead.emit()
|
||||||
Global.p_switch_active = false
|
|
||||||
Global.p_switch_timer = 0
|
|
||||||
stop_all_timers()
|
stop_all_timers()
|
||||||
Global.total_deaths += 1
|
Global.total_deaths += 1
|
||||||
sprite.process_mode = Node.PROCESS_MODE_ALWAYS
|
sprite.process_mode = Node.PROCESS_MODE_ALWAYS
|
||||||
@@ -804,8 +802,6 @@ func jump() -> void:
|
|||||||
gravity = JUMP_GRAVITY
|
gravity = JUMP_GRAVITY
|
||||||
AudioManager.play_sfx("small_jump" if power_state.hitbox_size == "Small" else "big_jump", global_position)
|
AudioManager.play_sfx("small_jump" if power_state.hitbox_size == "Small" else "big_jump", global_position)
|
||||||
has_jumped = true
|
has_jumped = true
|
||||||
await get_tree().physics_frame
|
|
||||||
has_jumped = true
|
|
||||||
|
|
||||||
func calculate_jump_height() -> float: # Thanks wye love you xxx
|
func calculate_jump_height() -> float: # Thanks wye love you xxx
|
||||||
return -(JUMP_HEIGHT + JUMP_INCR * int(abs(velocity.x) / 25))
|
return -(JUMP_HEIGHT + JUMP_INCR * int(abs(velocity.x) / 25))
|
||||||
|
@@ -123,7 +123,8 @@ func update_theme() -> void:
|
|||||||
Global.level_theme = theme
|
Global.level_theme = theme
|
||||||
Global.theme_time = theme_time
|
Global.theme_time = theme_time
|
||||||
TitleScreen.last_theme = theme
|
TitleScreen.last_theme = theme
|
||||||
$LevelBG.update_visuals()
|
if get_node_or_null("LevelBG") != null:
|
||||||
|
$LevelBG.update_visuals()
|
||||||
|
|
||||||
func update_next_level_info() -> void:
|
func update_next_level_info() -> void:
|
||||||
next_level = wrap(level_id + 1, 1, 5)
|
next_level = wrap(level_id + 1, 1, 5)
|
||||||
|
@@ -5,6 +5,7 @@ const DEFAULT_SFX_LIBRARY := {
|
|||||||
"big_jump": ("res://Assets/Audio/SFX/BigJump.wav"),
|
"big_jump": ("res://Assets/Audio/SFX/BigJump.wav"),
|
||||||
"coin": ("res://Assets/Audio/SFX/Coin.wav"),
|
"coin": ("res://Assets/Audio/SFX/Coin.wav"),
|
||||||
"bump": ("res://Assets/Audio/SFX/Bump.wav"),
|
"bump": ("res://Assets/Audio/SFX/Bump.wav"),
|
||||||
|
"skid": ("res://Assets/Audio/SFX/Skid.wav"),
|
||||||
"pipe": ("res://Assets/Audio/SFX/Pipe.wav"),
|
"pipe": ("res://Assets/Audio/SFX/Pipe.wav"),
|
||||||
"damage": ("res://Assets/Audio/SFX/Damage.wav"),
|
"damage": ("res://Assets/Audio/SFX/Damage.wav"),
|
||||||
"power_up": ("res://Assets/Audio/SFX/Powerup.wav"),
|
"power_up": ("res://Assets/Audio/SFX/Powerup.wav"),
|
||||||
|
@@ -327,6 +327,8 @@ func reset_values() -> void:
|
|||||||
Level.in_vine_level = false
|
Level.in_vine_level = false
|
||||||
Level.vine_return_level = ""
|
Level.vine_return_level = ""
|
||||||
Level.vine_warp_level = ""
|
Level.vine_warp_level = ""
|
||||||
|
p_switch_active = false
|
||||||
|
p_switch_timer = 0.0
|
||||||
|
|
||||||
func clear_saved_values() -> void:
|
func clear_saved_values() -> void:
|
||||||
coins = 0
|
coins = 0
|
||||||
|
@@ -12,9 +12,9 @@ var file := {
|
|||||||
"frame_limit" : 0,
|
"frame_limit" : 0,
|
||||||
},
|
},
|
||||||
"audio": {
|
"audio": {
|
||||||
"master": 10.0,
|
"master": 10,
|
||||||
"music": 10.0,
|
"music": 10,
|
||||||
"sfx": 10.0,
|
"sfx": 10,
|
||||||
"athletic_bgm": 1,
|
"athletic_bgm": 1,
|
||||||
"extra_bgm": 1,
|
"extra_bgm": 1,
|
||||||
"skid_sfx": 1,
|
"skid_sfx": 1,
|
||||||
@@ -24,8 +24,7 @@ var file := {
|
|||||||
},
|
},
|
||||||
"game": {
|
"game": {
|
||||||
"campaign": "SMB1",
|
"campaign": "SMB1",
|
||||||
"lang": "en",
|
"lang": "en"
|
||||||
"character": "0000"
|
|
||||||
},
|
},
|
||||||
"keyboard":
|
"keyboard":
|
||||||
{
|
{
|
||||||
|
@@ -27,4 +27,4 @@ func go_to_level() -> void:
|
|||||||
Global.transition_to_scene(LevelTransition.level_to_transition_to)
|
Global.transition_to_scene(LevelTransition.level_to_transition_to)
|
||||||
|
|
||||||
func play_pipe_sfx() -> void:
|
func play_pipe_sfx() -> void:
|
||||||
AudioManager.play_global_sfx("pipe")
|
AudioManager.play_sfx("pipe", $Player1.global_position)
|
||||||
|
@@ -48,7 +48,7 @@ func open() -> void:
|
|||||||
AudioManager.play_global_sfx("pause")
|
AudioManager.play_global_sfx("pause")
|
||||||
get_tree().paused = true
|
get_tree().paused = true
|
||||||
show()
|
show()
|
||||||
await get_tree().physics_frame
|
await get_tree().create_timer(0.1).timeout
|
||||||
active = true
|
active = true
|
||||||
|
|
||||||
func close() -> void:
|
func close() -> void:
|
||||||
@@ -56,7 +56,6 @@ func close() -> void:
|
|||||||
selected_index = 0
|
selected_index = 0
|
||||||
hide()
|
hide()
|
||||||
closed.emit()
|
closed.emit()
|
||||||
for i in 2:
|
await get_tree().create_timer(0.1).timeout
|
||||||
await get_tree().physics_frame
|
|
||||||
Global.game_paused = false
|
Global.game_paused = false
|
||||||
get_tree().paused = false
|
get_tree().paused = false
|
||||||
|
Reference in New Issue
Block a user