"save" & animate main menu, fix pause menu & restart (#3)

pause menu had classic issues of mouse inputs being eaten by something else (gravity)
restart didn't have working code anymore because of level logic changes
also remove the demo scene which I believe is unused beyond the jam version
This commit is contained in:
Taevas 2025-04-27 21:30:03 +02:00
parent 71441a9335
commit 38897c706a
Signed by: Taevas
SSH key fingerprint: SHA256:Y5Hv18xwPvUKSlgkx1sPnRO3L2mc03ehC7BzrnZVEyY
5 changed files with 184 additions and 75 deletions

View file

@ -13,6 +13,12 @@ const levels = [
\"res://levels/night/level.tscn\",
]
var loaded_level: Level
var loaded_level_scene: PackedScene
var loaded_level_path: String
func _enter_tree() -> void:
if len(loaded_level_path):
prepare_level(loaded_level_path)
func _ready() -> void:
var placeholders := carousel.get_children()
@ -30,8 +36,9 @@ func prepare_level(level_scene_path: String):
loaded_level.queue_free()
ResourceLoader.load_threaded_request(level_scene_path)
var level_scene = ResourceLoader.load_threaded_get(level_scene_path)
loaded_level = level_scene.instantiate()
loaded_level_scene = ResourceLoader.load_threaded_get(level_scene_path)
loaded_level = loaded_level_scene.instantiate()
loaded_level_path = level_scene_path
$VBoxContainer/Presentation/Thumbnail.texture = loaded_level.thumbnail
$VBoxContainer/Presentation/MarginContainer/VBoxContainer/LevelName.text = \"The \" + loaded_level.id.capitalize()
$VBoxContainer/Presentation.show()
@ -50,7 +57,7 @@ func display_file_data(data: Variant) -> void:
func _on_play_button_pressed() -> void:
if is_instance_valid(loaded_level):
request_play_level.emit(loaded_level)
request_play_level.emit(loaded_level, loaded_level_scene)
func seconds_to_readable(seconds: float) -> String:
var minutes: int = floor(seconds / 60)