feat: add sceneManager; add playerSpawnPos to sceneEntrance and sceneManager; update player node to use value from sceneManager; make sceneManager autoloaded;

This commit is contained in:
2026-08-18 15:22:00 +02:00
parent ac86097b07
commit a97800846f
7 changed files with 43 additions and 2 deletions
+2
View File
@@ -1,5 +1,6 @@
extends Area2D
@export var next_scene: String
@export var player_spawn_pos: Vector2
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
@@ -13,6 +14,7 @@ func _process(delta: float) -> void:
func _on_body_entered(body: Player) -> void:
print("body entered!")
$"/root/SceneManager".player_next_scene_spawn_pos = player_spawn_pos
get_tree().change_scene_to_file.call_deferred(next_scene)
pass # Replace with function body.