End of lesson 24.

This commit is contained in:
2025-04-07 21:12:10 -03:00
parent d44f69f731
commit 68a1e19ebe
13 changed files with 127 additions and 18 deletions

View File

@@ -0,0 +1,23 @@
extends Node
@export var entities:Node
var map:Map
func _ready():
CommandDispatcher.LOAD_MAP.connect(loadMap)
func loadMap(currentMapPath, newMapPath, spawnpoint, facing):
var newMap:Map = load(newMapPath).instantiate()
CommandDispatcher.PAUSE_PROCESSOR.emit()
if (currentMapPath != null):
currentMapPath.queue_free()
add_child(newMap)
entities.add_child(newMap.spawnPlayerAtPosition(spawnpoint, facing))
CommandDispatcher.WAIT_FOR_COMMAND.emit()