diff --git a/Scenes/Levels/TitleScreen.tscn b/Scenes/Levels/TitleScreen.tscn index 8c2f872..0e5f60c 100644 --- a/Scenes/Levels/TitleScreen.tscn +++ b/Scenes/Levels/TitleScreen.tscn @@ -486,6 +486,7 @@ text = "MENU_CONTINUE" uppercase = true [node name="HighScore" type="Label" parent="CanvasLayer/StoryMode/StoryOptions"] +unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 0 theme_override_colors/font_shadow_color = Color(0, 0, 0, 1) @@ -497,14 +498,9 @@ custom_minimum_size = Vector2(0, 16) layout_mode = 2 size_flags_horizontal = 4 -[node name="NoBeatenCharSelect" parent="CanvasLayer/StoryMode" instance=ExtResource("13_8wrri")] -visible = false -offset_left = -62.0 -offset_top = -35.0 -offset_right = 62.0 -offset_bottom = 35.0 +[node name="NewBeatenGame" type="Node" parent="CanvasLayer/StoryMode"] -[node name="QuestSelect" parent="CanvasLayer/StoryMode" instance=ExtResource("16_s06mt")] +[node name="QuestSelect" parent="CanvasLayer/StoryMode/NewBeatenGame" instance=ExtResource("16_s06mt")] unique_name_in_owner = true visible = false anchors_preset = 8 @@ -519,7 +515,7 @@ offset_bottom = 30.5 grow_horizontal = 2 grow_vertical = 2 -[node name="WorldSelect" parent="CanvasLayer/StoryMode" instance=ExtResource("10_emltp")] +[node name="WorldSelect" parent="CanvasLayer/StoryMode/NewBeatenGame" instance=ExtResource("10_emltp")] visible = false anchors_preset = 8 anchor_left = 0.5 @@ -533,7 +529,7 @@ offset_bottom = 26.0 grow_horizontal = 2 grow_vertical = 2 -[node name="LevelSelect" parent="CanvasLayer/StoryMode" instance=ExtResource("58_qgapq")] +[node name="LevelSelect" parent="CanvasLayer/StoryMode/NewBeatenGame" instance=ExtResource("58_qgapq")] visible = false anchors_preset = 8 anchor_left = 0.5 @@ -547,13 +543,60 @@ offset_bottom = 40.0 grow_horizontal = 2 grow_vertical = 2 -[node name="BeatenCharSelect" parent="CanvasLayer/StoryMode" instance=ExtResource("13_8wrri")] +[node name="BeatenCharSelect" parent="CanvasLayer/StoryMode/NewBeatenGame" instance=ExtResource("13_8wrri")] visible = false offset_left = -62.0 offset_top = -35.0 offset_right = 62.0 offset_bottom = 35.0 +[node name="ContinueBeatenGame" type="Node" parent="CanvasLayer/StoryMode"] + +[node name="WorldSelect" parent="CanvasLayer/StoryMode/ContinueBeatenGame" instance=ExtResource("10_emltp")] +visible = false +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -90.0 +offset_top = -32.5 +offset_right = 90.0 +offset_bottom = 32.5 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="LevelSelect" parent="CanvasLayer/StoryMode/ContinueBeatenGame" instance=ExtResource("58_qgapq")] +visible = false +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -128.0 +offset_top = -40.0 +offset_right = 128.0 +offset_bottom = 40.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="CharSelect" parent="CanvasLayer/StoryMode/ContinueBeatenGame" instance=ExtResource("13_8wrri")] +visible = false + +[node name="NewUnbeatenGame" type="Node" parent="CanvasLayer/StoryMode"] + +[node name="NoBeatenCharSelect" parent="CanvasLayer/StoryMode/NewUnbeatenGame" instance=ExtResource("13_8wrri")] +visible = false +offset_left = -62.0 +offset_top = -35.0 +offset_right = 62.0 +offset_bottom = 35.0 + +[node name="ContinueUnbeatenGame" type="Node" parent="CanvasLayer/StoryMode"] + +[node name="CharacterSelect" parent="CanvasLayer/StoryMode/ContinueUnbeatenGame" instance=ExtResource("13_8wrri")] +visible = false + [node name="ChallengeOptions" type="VBoxContainer" parent="CanvasLayer" node_paths=PackedStringArray("options")] unique_name_in_owner = true visible = false @@ -1461,7 +1504,9 @@ metadata/_custom_type_script = "uid://cbal8ms2oe1ik" [connection signal="option_3_selected" from="CanvasLayer/Options1" to="CanvasLayer/Options1" method="close"] [connection signal="option_3_selected" from="CanvasLayer/Options1" to="CanvasLayer/Extras" method="open"] [connection signal="closed" from="CanvasLayer/Options2" to="CanvasLayer/Options1" method="open"] -[connection signal="option_1_selected" from="CanvasLayer/Options2" to="." method="continue_story"] +[connection signal="option_1_selected" from="CanvasLayer/Options2" to="." method="get_highscore"] +[connection signal="option_1_selected" from="CanvasLayer/Options2" to="CanvasLayer/Options2" method="close"] +[connection signal="option_1_selected" from="CanvasLayer/Options2" to="CanvasLayer/StoryMode/StoryOptions" method="open"] [connection signal="option_2_selected" from="CanvasLayer/Options2" to="CanvasLayer/Options2" method="close"] [connection signal="option_2_selected" from="CanvasLayer/Options2" to="CanvasLayer/ChallengeOptions" method="open"] [connection signal="option_3_selected" from="CanvasLayer/Options2" to="CanvasLayer/MarathonMode/MarathonSelect" method="open"] @@ -1469,18 +1514,28 @@ metadata/_custom_type_script = "uid://cbal8ms2oe1ik" [connection signal="option_1_selected" from="CanvasLayer/Extras" to="." method="go_to_achievement_menu"] [connection signal="option_2_selected" from="CanvasLayer/Extras" to="." method="go_to_credits"] [connection signal="closed" from="CanvasLayer/StoryMode/StoryOptions" to="." method="on_story_options_closed"] -[connection signal="option_1_selected" from="CanvasLayer/StoryMode/StoryOptions" to="." method="new_game"] -[connection signal="option_2_selected" from="CanvasLayer/StoryMode/StoryOptions" to="." method="continue_story"] -[connection signal="cancelled" from="CanvasLayer/StoryMode/NoBeatenCharSelect" to="CanvasLayer/Options2" method="open"] -[connection signal="selected" from="CanvasLayer/StoryMode/NoBeatenCharSelect" to="." method="start_game"] -[connection signal="cancelled" from="CanvasLayer/StoryMode/QuestSelect" to="CanvasLayer/Options2" method="open"] -[connection signal="selected" from="CanvasLayer/StoryMode/QuestSelect" to="CanvasLayer/StoryMode/WorldSelect" method="open"] -[connection signal="cancelled" from="CanvasLayer/StoryMode/WorldSelect" to="CanvasLayer/StoryMode/QuestSelect" method="open"] -[connection signal="world_selected" from="CanvasLayer/StoryMode/WorldSelect" to="CanvasLayer/StoryMode/LevelSelect" method="open"] -[connection signal="cancelled" from="CanvasLayer/StoryMode/LevelSelect" to="CanvasLayer/StoryMode/WorldSelect" method="open"] -[connection signal="level_selected" from="CanvasLayer/StoryMode/LevelSelect" to="CanvasLayer/StoryMode/BeatenCharSelect" method="open"] -[connection signal="cancelled" from="CanvasLayer/StoryMode/BeatenCharSelect" to="CanvasLayer/StoryMode/LevelSelect" method="open"] -[connection signal="selected" from="CanvasLayer/StoryMode/BeatenCharSelect" to="." method="start_game"] +[connection signal="option_1_selected" from="CanvasLayer/StoryMode/StoryOptions" to="." method="new_game_selected"] +[connection signal="option_2_selected" from="CanvasLayer/StoryMode/StoryOptions" to="." method="continue_game"] +[connection signal="cancelled" from="CanvasLayer/StoryMode/NewBeatenGame/QuestSelect" to="CanvasLayer/StoryMode/StoryOptions" method="open"] +[connection signal="selected" from="CanvasLayer/StoryMode/NewBeatenGame/QuestSelect" to="CanvasLayer/StoryMode/NewBeatenGame/WorldSelect" method="open"] +[connection signal="cancelled" from="CanvasLayer/StoryMode/NewBeatenGame/WorldSelect" to="CanvasLayer/StoryMode/NewBeatenGame/QuestSelect" method="open"] +[connection signal="world_selected" from="CanvasLayer/StoryMode/NewBeatenGame/WorldSelect" to="CanvasLayer/StoryMode/NewBeatenGame/LevelSelect" method="open"] +[connection signal="cancelled" from="CanvasLayer/StoryMode/NewBeatenGame/LevelSelect" to="CanvasLayer/StoryMode/NewBeatenGame/WorldSelect" method="open"] +[connection signal="level_selected" from="CanvasLayer/StoryMode/NewBeatenGame/LevelSelect" to="CanvasLayer/StoryMode/NewBeatenGame/BeatenCharSelect" method="open"] +[connection signal="cancelled" from="CanvasLayer/StoryMode/NewBeatenGame/BeatenCharSelect" to="CanvasLayer/StoryMode/NewBeatenGame/LevelSelect" method="open"] +[connection signal="selected" from="CanvasLayer/StoryMode/NewBeatenGame/BeatenCharSelect" to="." method="start_game"] +[connection signal="selected" from="CanvasLayer/StoryMode/NewBeatenGame/BeatenCharSelect" to="." method="clear_stats"] +[connection signal="cancelled" from="CanvasLayer/StoryMode/ContinueBeatenGame/WorldSelect" to="CanvasLayer/StoryMode/StoryOptions" method="open"] +[connection signal="world_selected" from="CanvasLayer/StoryMode/ContinueBeatenGame/WorldSelect" to="CanvasLayer/StoryMode/ContinueBeatenGame/LevelSelect" method="open"] +[connection signal="cancelled" from="CanvasLayer/StoryMode/ContinueBeatenGame/LevelSelect" to="CanvasLayer/StoryMode/ContinueBeatenGame/WorldSelect" method="open"] +[connection signal="level_selected" from="CanvasLayer/StoryMode/ContinueBeatenGame/LevelSelect" to="CanvasLayer/StoryMode/ContinueBeatenGame/CharSelect" method="open"] +[connection signal="cancelled" from="CanvasLayer/StoryMode/ContinueBeatenGame/CharSelect" to="CanvasLayer/StoryMode/ContinueBeatenGame/LevelSelect" method="open"] +[connection signal="selected" from="CanvasLayer/StoryMode/ContinueBeatenGame/CharSelect" to="." method="start_game"] +[connection signal="cancelled" from="CanvasLayer/StoryMode/NewUnbeatenGame/NoBeatenCharSelect" to="CanvasLayer/StoryMode/StoryOptions" method="open"] +[connection signal="selected" from="CanvasLayer/StoryMode/NewUnbeatenGame/NoBeatenCharSelect" to="." method="start_game"] +[connection signal="selected" from="CanvasLayer/StoryMode/NewUnbeatenGame/NoBeatenCharSelect" to="." method="clear_stats"] +[connection signal="cancelled" from="CanvasLayer/StoryMode/ContinueUnbeatenGame/CharacterSelect" to="CanvasLayer/StoryMode/StoryOptions" method="open"] +[connection signal="selected" from="CanvasLayer/StoryMode/ContinueUnbeatenGame/CharacterSelect" to="." method="start_game"] [connection signal="closed" from="CanvasLayer/ChallengeOptions" to="CanvasLayer/Options2" method="open"] [connection signal="option_1_selected" from="CanvasLayer/ChallengeOptions" to="." method="go_to_boo_menu"] [connection signal="option_2_selected" from="CanvasLayer/ChallengeOptions" to="." method="challenge_hunt_selected"] diff --git a/Scripts/Classes/Components/ResourceSetterNew.gd b/Scripts/Classes/Components/ResourceSetterNew.gd index 8976e00..407d01d 100644 --- a/Scripts/Classes/Components/ResourceSetterNew.gd +++ b/Scripts/Classes/Components/ResourceSetterNew.gd @@ -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() diff --git a/Scripts/Classes/Singletons/SaveManager.gd b/Scripts/Classes/Singletons/SaveManager.gd index 5be8bbc..68ce0df 100644 --- a/Scripts/Classes/Singletons/SaveManager.gd +++ b/Scripts/Classes/Singletons/SaveManager.gd @@ -43,7 +43,8 @@ const SAVE_TEMPLATE := { -1.0, -1.0, -1.0, -1.0 ], "HighScore": 0, - "ExtraWorldWin": false + "ExtraWorldWin": false, + "CurrentQuest": 1 } diff --git a/Scripts/Classes/States/Player/Normal.gd b/Scripts/Classes/States/Player/Normal.gd index db12bee..21ac11d 100644 --- a/Scripts/Classes/States/Player/Normal.gd +++ b/Scripts/Classes/States/Player/Normal.gd @@ -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: diff --git a/Scripts/Parts/TitleScreen.gd b/Scripts/Parts/TitleScreen.gd index 8d66c30..1a4721a 100644 --- a/Scripts/Parts/TitleScreen.gd +++ b/Scripts/Parts/TitleScreen.gd @@ -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() diff --git a/Scripts/UI/CharacterSelect.gd b/Scripts/UI/CharacterSelect.gd index 047b0fa..c9acbf2 100644 --- a/Scripts/UI/CharacterSelect.gd +++ b/Scripts/UI/CharacterSelect.gd @@ -106,3 +106,7 @@ func select() -> void: func close() -> void: active = false hide() + + +func on_selected() -> void: + pass # Replace with function body. diff --git a/Scripts/UI/LevelSelect.gd b/Scripts/UI/LevelSelect.gd index d0fe30a..1fb7e5c 100644 --- a/Scripts/UI/LevelSelect.gd +++ b/Scripts/UI/LevelSelect.gd @@ -196,3 +196,7 @@ func cleanup() -> void: func close() -> void: active = false hide() + + +func on_level_selected() -> void: + pass # Replace with function body.