frame-of-mind/src/dev-util/room_template.gd

49 lines
793 B
GDScript

class_name RoomTemplate extends Node3D
var initialised: bool = false
var id: State.rooms = State.rooms.NULL
var has_stage: bool:
set(value):
has_stage = value
if has_stage and not initialised:
start_room()
var save_game:SaveGame = null
signal proceed(next_scene_path: String)
func _ready() -> void:
State.room = self
State.current_room = id
func load():
# Override this function to load the state of the chapter from State.save_game
pass
func play() -> String:
get_ready()
start_room()
return await proceed
func get_ready():
pass
func start_room():
pass
func pull_save_state(save: SaveGame) -> void:
pass
func save_room():
pull_save_state(save_game)
save_game.save_to_file(get_tree().root.get_texture())
func prepare_transition():
pass
func unload():
pass