mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 15:38:14 +00:00
There! you can now reset your campaign WITHOUT worrying about deleting everything else
This commit is contained in:
@@ -34,7 +34,7 @@ var update_on_spawn := true
|
||||
func _init() -> void:
|
||||
set_process_mode(Node.PROCESS_MODE_ALWAYS)
|
||||
|
||||
func _ready() -> void:
|
||||
func _enter_tree() -> void:
|
||||
safety_check()
|
||||
if update_on_spawn:
|
||||
update_resource()
|
||||
|
@@ -43,7 +43,8 @@ const SAVE_TEMPLATE := {
|
||||
-1.0, -1.0, -1.0, -1.0
|
||||
],
|
||||
"HighScore": 0,
|
||||
"ExtraWorldWin": false
|
||||
"ExtraWorldWin": false,
|
||||
"CurrentQuest": 1
|
||||
}
|
||||
|
||||
|
||||
|
@@ -105,7 +105,6 @@ func ground_acceleration(delta: float) -> void:
|
||||
target_accel = player.RUN_SKID
|
||||
else:
|
||||
target_accel = player.WALK_SKID
|
||||
|
||||
player.velocity.x = move_toward(player.velocity.x, target_move_speed * player.input_direction, (target_accel / delta) * delta)
|
||||
|
||||
func deceleration(delta: float) -> void:
|
||||
|
@@ -115,17 +115,14 @@ func check_for_ghost() -> void:
|
||||
else:
|
||||
$CanvasLayer/MarathonMode/HasWarp/CharacterSelect.open()
|
||||
|
||||
func get_highscore() -> void:
|
||||
%HighScore.text = "TOP- " + str(Global.high_score).pad_zeros(6)
|
||||
|
||||
func new_game() -> void:
|
||||
if Global.score > 0 or Global.coins > 0 or Global.player_power_states != "0000" or Global.world_num > 1 or Global.level_num > 1:
|
||||
$CanvasLayer/SaveDeletionWarning.open()
|
||||
await $CanvasLayer/SaveDeletionWarning.selected
|
||||
if $CanvasLayer/SaveDeletionWarning.selected_index == 1:
|
||||
active_options.active = true
|
||||
return
|
||||
Global.current_game_mode = Global.GameMode.CAMPAIGN
|
||||
SaveManager.clear_save()
|
||||
start_game()
|
||||
func clear_stats() -> void:
|
||||
Global.clear_saved_values()
|
||||
Global.world_num = 1
|
||||
Global.level_num = 1
|
||||
LevelTransition.level_to_transition_to = Level.get_scene_string(Global.world_num, Global.level_num)
|
||||
|
||||
func start_game() -> void:
|
||||
PipeCutscene.seen_cutscene = false
|
||||
@@ -222,6 +219,19 @@ func open_options() -> void:
|
||||
func quit_game() -> void:
|
||||
get_tree().quit()
|
||||
|
||||
func new_game_selected() -> void:
|
||||
Global.current_game_mode = Global.GameMode.CAMPAIGN
|
||||
if Global.game_beaten:
|
||||
%QuestSelect.open()
|
||||
else:
|
||||
$CanvasLayer/StoryMode/NewUnbeatenGame/NoBeatenCharSelect.open()
|
||||
|
||||
func continue_game() -> void:
|
||||
Global.current_game_mode = Global.GameMode.CAMPAIGN
|
||||
if Global.game_beaten:
|
||||
$CanvasLayer/StoryMode/ContinueBeatenGame/WorldSelect.open()
|
||||
else:
|
||||
$CanvasLayer/StoryMode/ContinueUnbeatenGame/CharacterSelect.open()
|
||||
|
||||
func on_story_options_closed() -> void:
|
||||
$CanvasLayer/Options2.open()
|
||||
|
@@ -106,3 +106,7 @@ func select() -> void:
|
||||
func close() -> void:
|
||||
active = false
|
||||
hide()
|
||||
|
||||
|
||||
func on_selected() -> void:
|
||||
pass # Replace with function body.
|
||||
|
@@ -196,3 +196,7 @@ func cleanup() -> void:
|
||||
func close() -> void:
|
||||
active = false
|
||||
hide()
|
||||
|
||||
|
||||
func on_level_selected() -> void:
|
||||
pass # Replace with function body.
|
||||
|
Reference in New Issue
Block a user