mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-24 00:10:52 +00:00
stuff
This commit is contained in:
@@ -1 +1,4 @@
|
||||
extends Node
|
||||
class_name CustomLevel
|
||||
extends Level
|
||||
|
||||
var sublevel_id := 0
|
||||
|
||||
@@ -32,7 +32,7 @@ var selected_tile_index := 0
|
||||
|
||||
var can_move_cam := true
|
||||
|
||||
var music_track_list: Array[String] = [ "res://Assets/Audio/BGM/Silence.json","res://Assets/Audio/BGM/Athletic.json", "res://Assets/Audio/BGM/Autumn.json", "res://Assets/Audio/BGM/Beach.json", "res://Assets/Audio/BGM/Bonus.json", "res://Assets/Audio/BGM/Bowser.json", "res://Assets/Audio/BGM/FinalBowser.json", "res://Assets/Audio/BGM/Castle.json", "res://Assets/Audio/BGM/CoinHeaven.json", "res://Assets/Audio/BGM/Desert.json", "res://Assets/Audio/BGM/Garden.json", "res://Assets/Audio/BGM/GhostHouse.json", "res://Assets/Audio/BGM/Jungle.json", "res://Assets/Audio/BGM/Mountain.json", "res://Assets/Audio/BGM/Overworld.json", "res://Assets/Audio/BGM/Pipeland.json", "res://Assets/Audio/BGM/BooRace.json", "res://Assets/Audio/BGM/Sky.json", "res://Assets/Audio/BGM/Snow.json", "res://Assets/Audio/BGM/Space.json", "res://Assets/Audio/BGM/Underground.json", "res://Assets/Audio/BGM/Underwater.json", "res://Assets/Audio/BGM/Volcano.json", "res://Assets/Audio/BGM/Airship.json"]
|
||||
static var music_track_list: Array[String] = [ "res://Assets/Audio/BGM/Silence.json","res://Assets/Audio/BGM/Athletic.json", "res://Assets/Audio/BGM/Autumn.json", "res://Assets/Audio/BGM/Beach.json", "res://Assets/Audio/BGM/Bonus.json", "res://Assets/Audio/BGM/Bowser.json", "res://Assets/Audio/BGM/FinalBowser.json", "res://Assets/Audio/BGM/Castle.json", "res://Assets/Audio/BGM/CoinHeaven.json", "res://Assets/Audio/BGM/Desert.json", "res://Assets/Audio/BGM/Garden.json", "res://Assets/Audio/BGM/GhostHouse.json", "res://Assets/Audio/BGM/Jungle.json", "res://Assets/Audio/BGM/Mountain.json", "res://Assets/Audio/BGM/Overworld.json", "res://Assets/Audio/BGM/Pipeland.json", "res://Assets/Audio/BGM/BooRace.json", "res://Assets/Audio/BGM/Sky.json", "res://Assets/Audio/BGM/Snow.json", "res://Assets/Audio/BGM/Space.json", "res://Assets/Audio/BGM/Underground.json", "res://Assets/Audio/BGM/Underwater.json", "res://Assets/Audio/BGM/Volcano.json", "res://Assets/Audio/BGM/Airship.json"]
|
||||
var music_track_names: Array[String] = ["BGM_NONE", "BGM_ATHLETIC", "BGM_AUTUMN", "BGM_BEACH", "BGM_BONUS", "BGM_BOWSER", "BGM_FINALBOWSER", "BGM_CASTLE", "BGM_COINHEAVEN", "BGM_DESERT", "BGM_GARDEN", "BGM_GHOSTHOUSE", "BGM_JUNGLE", "BGM_MOUNTAIN", "BGM_OVERWORLD", "BGM_PIPELAND", "BGM_RACE", "BGM_SKY", "BGM_SNOW", "BGM_SPACE", "BGM_UNDERGROUND", "BGM_UNDERWATER", "BGM_VOLCANO", "BGM_AIRSHIP"]
|
||||
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@ func _ready() -> void:
|
||||
await get_tree().physics_frame
|
||||
if locked:
|
||||
check_if_unlocked(false)
|
||||
if exiting_door_id != -1:
|
||||
run_door_check()
|
||||
|
||||
func _physics_process(_delta: float) -> void:
|
||||
for i in $PlayerDetection.get_overlapping_areas():
|
||||
@@ -110,7 +112,7 @@ func player_enter(player: Player) -> void:
|
||||
LevelEditor.play_door_transition = true
|
||||
AudioManager.play_sfx("door_open", global_position)
|
||||
await get_tree().create_timer(0.5, false).timeout
|
||||
if Global.level_editor.sub_level_id == sublevel_id:
|
||||
if Global.current_level.sublevel_id == sublevel_id:
|
||||
Global.do_fake_transition()
|
||||
if Global.fade_transition:
|
||||
await get_tree().create_timer(0.25, false).timeout
|
||||
@@ -119,7 +121,7 @@ func player_enter(player: Player) -> void:
|
||||
i.run_door_check()
|
||||
else:
|
||||
same_scene_exiting_door = null
|
||||
Global.level_editor.transition_to_sublevel(sublevel_id)
|
||||
Global.transition_to_scene(NewLevelBuilder.sub_levels[sublevel_id])
|
||||
can_enter = true
|
||||
|
||||
func freeze_player(player: Player) -> void:
|
||||
|
||||
@@ -229,7 +229,7 @@ func _ready() -> void:
|
||||
handle_power_up_states(0)
|
||||
set_power_state_frame()
|
||||
handle_invincible_palette()
|
||||
if Global.level_editor == null:
|
||||
if [Global.GameMode.LEVEL_EDITOR, Global.GameMode.CUSTOM_LEVEL].has(Global.current_game_mode):
|
||||
recenter_camera()
|
||||
|
||||
func apply_character_physics() -> void:
|
||||
|
||||
@@ -3,10 +3,12 @@ extends Node2D
|
||||
|
||||
@export var reset_on_delete := true
|
||||
@export var lock_camera := false
|
||||
@export var set_on_load := true
|
||||
|
||||
func _enter_tree() -> void:
|
||||
add_to_group("CameraLimits")
|
||||
Player.camera_right_limit = int(global_position.x)
|
||||
if set_on_load or is_node_ready():
|
||||
Player.camera_right_limit = int(global_position.x)
|
||||
|
||||
func _exit_tree() -> void:
|
||||
if reset_on_delete:
|
||||
|
||||
@@ -58,8 +58,10 @@ func on_area_entered(area: Area2D) -> void:
|
||||
old_state = LevelPersistance.active_nodes.duplicate(true)
|
||||
unlocked_doors = Door.unlocked_doors.duplicate()
|
||||
Level.start_level_path = Global.current_level.scene_file_path
|
||||
if Global.current_game_mode == Global.GameMode.LEVEL_EDITOR or Global.current_game_mode == Global.GameMode.CUSTOM_LEVEL:
|
||||
if Global.current_game_mode == Global.GameMode.LEVEL_EDITOR:
|
||||
sublevel_id = Global.level_editor.sub_level_id
|
||||
elif Global.current_game_mode == Global.GameMode.CUSTOM_LEVEL:
|
||||
sublevel_id = Global.current_level.sublevel_id
|
||||
if Settings.file.difficulty.checkpoint_style == 2 and has_meta("is_flag"):
|
||||
if player.power_state.state_name == "Small":
|
||||
player.get_power_up("Big")
|
||||
|
||||
@@ -1,16 +1,8 @@
|
||||
extends Node2D
|
||||
|
||||
func _enter_tree() -> void:
|
||||
hide()
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
hide()
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
hide()
|
||||
|
||||
func _ready() -> void:
|
||||
hide()
|
||||
update()
|
||||
|
||||
func update() -> void:
|
||||
visible = !LevelEditor.playing_level and Global.current_game_mode == Global.GameMode.LEVEL_EDITOR
|
||||
|
||||
@@ -100,8 +100,17 @@ func _ready() -> void:
|
||||
$Timer.start()
|
||||
else:
|
||||
if NewLevelBuilder.sub_levels == [null, null, null, null, null]:
|
||||
Global.clear_saved_values()
|
||||
Global.reset_values()
|
||||
wait_for_build_completion()
|
||||
NewLevelBuilder.load_level(LevelEditor.level_file)
|
||||
transition()
|
||||
else:
|
||||
await get_tree().create_timer(0.1, false).timeout
|
||||
can_transition = true
|
||||
|
||||
func wait_for_build_completion() -> void:
|
||||
await NewLevelBuilder.level_building_complete
|
||||
can_transition = true
|
||||
|
||||
func handle_challenge_mode_transition() -> void:
|
||||
$BG/Control/LivesCount.hide()
|
||||
@@ -132,7 +141,6 @@ func transition() -> void:
|
||||
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:
|
||||
|
||||
Reference in New Issue
Block a user