19 lines
456 B
GDScript
19 lines
456 B
GDScript
extends RoomState
|
|
|
|
|
|
func _enter(_previous_state_path: String, _data: Dictionary = {}) -> void:
|
|
print("entering room")
|
|
room.player = _instantiate_player()
|
|
assert(room.player != null, "player is null")
|
|
room.camera.global_position = room.config.camera_position
|
|
|
|
finished.emit(PLAYING)
|
|
return
|
|
|
|
|
|
func _instantiate_player() -> Player:
|
|
var p: Player = room.player_scene.instantiate()
|
|
room.add_child(p)
|
|
p.global_position = room.initial_spawn
|
|
|
|
return p
|