add game director singleton with goto_room method
This commit is contained in:
parent
f6cf980ac5
commit
d4bf3241c5
2 changed files with 10 additions and 0 deletions
9
scenes/autoload/game_director.gd
Normal file
9
scenes/autoload/game_director.gd
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
extends Node
|
||||
|
||||
|
||||
func goto_room(previous_room: Room, waypoint: Waypoint) -> void:
|
||||
print("changing rooms")
|
||||
await previous_room.tree_exited
|
||||
var next_room: Room = waypoint.to_scene.instantiate()
|
||||
next_room.initial_spawn = waypoint.spawn_coordinates
|
||||
get_tree().root.add_child(next_room)
|
||||
1
scenes/autoload/game_director.gd.uid
Normal file
1
scenes/autoload/game_director.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://b4ydqderhu3mr
|
||||
Loading…
Add table
Reference in a new issue