"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:
parent
71441a9335
commit
38897c706a
5 changed files with 184 additions and 75 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue