main.gd

Extends: Node

Description

Escoria main room handling and scene switcher

Property Descriptions

last_scene_global_id

var last_scene_global_id: String

Global id of the last scene the player was before current scene

current_scene

var current_scene: Node

Current scene room being displayed

previous_scene

var previous_scene: Node

Scene that was previously the current scene.

wait_level

var wait_level

The Escoria context currently in wait state

scene_transition

var scene_transition: ESCTransitionPlayer

Reference to the scene transition node

Method Descriptions

set_scene

func set_scene(p_scene: Node) -> void

Set current scene

Parameters

  • p_scene: Scene to set

finish_current_scene_init

func finish_current_scene_init(p_scene: Node) -> void

Only called by the room manager in the case where it hasn’t executed a coroutine prior to calling set_scene_finish().

Parameters

  • p_scene: The scene currently being initialized by set_scene.

set_scene_finish

func set_scene_finish() -> void

Completes the room swap and should be called by the room manager at the appropriate time.

clear_previous_scene

func clear_previous_scene() -> void

Cleanup the previous scene if there was one.

set_camera_limits

func set_camera_limits(camera_limit_id: int = 0, scene: Node) -> void

Set the camera limits

Parameters

  • camera_limits_id: The id of the room’s camera limits to set

  • scene: The scene to set the camera limits for. We make this optional since most times it’ll be current_scene that needs setting; however, e.g. when starting up Escoria, we might not have already set the current_scene.

save_game

func save_game(p_savegame_res: Resource) -> void

check_game_scene_methods

func check_game_scene_methods()

Sanity check that the game.tscn scene’s root node script MUST implement the following methods. If they do not exist, stop immediately. Implement them, even if empty

Signals

  • signal room_ready(): Signal sent when the room is loaded and ready.