mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-23 07:58:09 +00:00
improvements
This commit is contained in:
@@ -4,6 +4,7 @@ extends Block
|
||||
var ticking_down := false
|
||||
|
||||
func _ready() -> void:
|
||||
if item == null: return
|
||||
if item_amount == 10 and item.resource_path == "res://Scenes/Prefabs/Entities/Items/SpinningCoin.tscn" and is_instance_valid(Global.level_editor) == false:
|
||||
Global.log_warning("Coin Brick Block is wrong! please report!: " + name)
|
||||
|
||||
|
||||
1
Scripts/Classes/CustomLevel.gd
Normal file
1
Scripts/Classes/CustomLevel.gd
Normal file
@@ -0,0 +1 @@
|
||||
extends Node
|
||||
1
Scripts/Classes/CustomLevel.gd.uid
Normal file
1
Scripts/Classes/CustomLevel.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c0kflqgd1w6sg
|
||||
@@ -20,8 +20,8 @@ func _ready() -> void:
|
||||
$Platform/ScoreNoteSpawner.owner = $Platform
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if not dropped:
|
||||
$Rope.size.y = platform.global_position.y - rope_top
|
||||
if not dropped and is_instance_valid($Rope):
|
||||
$Rope.size.y = $Platform.global_position.y - rope_top
|
||||
$Rope.global_position.y = rope_top
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
|
||||
@@ -781,7 +781,7 @@ func enter_pipe(pipe: PipeArea, warp_to_level := true) -> void:
|
||||
await get_tree().create_timer(1, false).timeout
|
||||
if Global.current_game_mode == Global.GameMode.LEVEL_EDITOR or Global.current_game_mode == Global.GameMode.CUSTOM_LEVEL:
|
||||
LevelEditor.play_pipe_transition = true
|
||||
owner.transition_to_sublevel(pipe.target_sub_level)
|
||||
Global.transition_to_scene(NewLevelBuilder.sub_levels[pipe.target_sub_level])
|
||||
else:
|
||||
Global.transition_to_scene(pipe.target_level)
|
||||
|
||||
|
||||
@@ -342,7 +342,7 @@ func clear_saved_values() -> void:
|
||||
lives = 3
|
||||
player_power_states = "0000"
|
||||
|
||||
func transition_to_scene(scene_path := "") -> void:
|
||||
func transition_to_scene(scene_path = "") -> void:
|
||||
Global.fade_transition = bool(Settings.file.visuals.transition_animation)
|
||||
if transitioning_scene:
|
||||
return
|
||||
@@ -355,7 +355,10 @@ func transition_to_scene(scene_path := "") -> void:
|
||||
%TransitionBlock.modulate.a = 1
|
||||
$Transition.show()
|
||||
await get_tree().create_timer(0.1, true).timeout
|
||||
get_tree().change_scene_to_file(scene_path)
|
||||
if scene_path is String:
|
||||
get_tree().change_scene_to_file(scene_path)
|
||||
elif scene_path is PackedScene:
|
||||
get_tree().change_scene_to_packed(scene_path)
|
||||
await get_tree().scene_changed
|
||||
await get_tree().create_timer(0.15, true).timeout
|
||||
if fade_transition:
|
||||
|
||||
@@ -41,7 +41,6 @@ func handle_main_hud() -> void:
|
||||
if current_chara != Global.player_characters[0]:
|
||||
update_character_info()
|
||||
%CharacterIcon.get_node("Shadow").texture = %CharacterIcon.texture
|
||||
%ModernLifeCount.text = "*" + (str(Global.lives).pad_zeros(2) if Settings.file.difficulty.inf_lives == 0 else "∞")
|
||||
%CharacterIcon.visible = Global.current_game_mode != Global.GameMode.BOO_RACE
|
||||
%ModernLifeCount.visible = Global.current_game_mode != Global.GameMode.BOO_RACE
|
||||
var world_num := str(Global.world_num)
|
||||
@@ -82,6 +81,14 @@ func handle_modern_hud() -> void:
|
||||
%ModernTime.text = "⏲" + str(Global.time).pad_zeros(3)
|
||||
%ModernKeyCount.visible = KeyItem.total_collected > 0
|
||||
%ModernKeyAmount.text = "*" + str(KeyItem.total_collected).pad_zeros(2)
|
||||
if Global.current_game_mode == Global.GameMode.CUSTOM_LEVEL:
|
||||
$ModernHUD/TopLeft/LifeCount.hide()
|
||||
%DeathCountLabel.show()
|
||||
%DeathCountLabel.text = "☠*" + str(Global.total_deaths).pad_zeros(2)
|
||||
else:
|
||||
$ModernHUD/TopLeft/LifeCount.show()
|
||||
%DeathCountLabel.hide()
|
||||
%ModernLifeCount.text = "*" + (str(Global.lives).pad_zeros(2) if Settings.file.difficulty.inf_lives == 0 else "∞")
|
||||
if get_tree().get_first_node_in_group("Players") == null or Settings.file.difficulty.time_limit == 0:
|
||||
%ModernTime.text = "⏲---"
|
||||
|
||||
|
||||
@@ -60,7 +60,6 @@ func _ready() -> void:
|
||||
SpeedrunHandler.timer = 0
|
||||
get_tree().call_group("PlayerGhosts", "delete")
|
||||
get_tree().paused = false
|
||||
$Timer.start()
|
||||
AudioManager.stop_music_override(AudioManager.MUSIC_OVERRIDES.NONE, true)
|
||||
AudioManager.music_player.stop()
|
||||
PipeArea.exiting_pipe_id = -1
|
||||
@@ -96,7 +95,13 @@ func _ready() -> void:
|
||||
%CustomLevelName.text = LevelEditor.level_name
|
||||
|
||||
await get_tree().create_timer(0.1, false).timeout
|
||||
can_transition = true
|
||||
if Global.current_game_mode != Global.GameMode.CUSTOM_LEVEL:
|
||||
can_transition = true
|
||||
$Timer.start()
|
||||
else:
|
||||
if NewLevelBuilder.sub_levels == [null, null, null, null, null]:
|
||||
NewLevelBuilder.load_level(LevelEditor.level_file)
|
||||
transition()
|
||||
|
||||
func handle_challenge_mode_transition() -> void:
|
||||
$BG/Control/LivesCount.hide()
|
||||
@@ -124,8 +129,11 @@ func transition() -> void:
|
||||
Global.transition_to_scene(PIPE_CUTSCENE_OVERRIDE[Global.current_campaign][[Global.world_num, Global.level_num]])
|
||||
else:
|
||||
Global.transition_to_scene("res://Scenes/Levels/PipeCutscene.tscn")
|
||||
else:
|
||||
elif Global.current_game_mode != Global.GameMode.CUSTOM_LEVEL:
|
||||
Global.transition_to_scene(level_to_transition_to)
|
||||
else:
|
||||
await get_tree().create_timer(0.25, false).timeout
|
||||
Global.transition_to_scene(NewLevelBuilder.sub_levels[Checkpoint.sublevel_id])
|
||||
|
||||
func show_best_time() -> void:
|
||||
var best_time = SpeedrunHandler.best_time
|
||||
|
||||
@@ -27,6 +27,8 @@ func _ready() -> void:
|
||||
AudioManager.stop_all_music()
|
||||
Global.second_quest = false
|
||||
%LevelList.open(true)
|
||||
for i in 5:
|
||||
NewLevelBuilder.sub_levels[i] = null
|
||||
await get_tree().process_frame
|
||||
if last_played_container != null:
|
||||
print(saved_search_values)
|
||||
|
||||
Reference in New Issue
Block a user