Skip to content

Master Manager

superwhack edited this page Jul 10, 2026 · 19 revisions

System Summary

The Master Manager handles transitioning between the different states of the project, like the edit and play states.


Connected Systems

List of connecting/parent/subsystems.

Connecting Systems: This system only consists of subsystems.

Subsystems:


Related Controls

List of related controls.

Key(s):

  • Play Button: Shows the play scene when clicked
  • Pause Button: Shows the edit scene when clicked
  • Reset Button: Resets the play scene when clicked

Bugs

List of known bugs. Be descriptive but keep it brief!

  • The transition to the play scene does not fully close the edit scene, so tiles from there are invisible but can be interacted with. This will likely be fixed when carrying over tiles is implemented.

Feature List / Breakdown of Features

List of features and descriptions within system.

Feature Name:

  • State Switch: Switches the state from editing/playing. This sets all flags and scenes as the user may expect when switching.
  • Loading Screen Transitions: Displays a screen wipe animation before expensive state transitions begin and hides it only after the destination state has finished initializing.
  • Saving and Loading Tilemaps: Saves and loads tilemaps from their resource in the user folder.
  • Creating a Border: Creates a border around the buildable grid.
  • Screen Transitions: Shows a loading screen with a dithered fade transition whenever switching between screens.

Important Variables

Name the most important variables, their type, and what their purpose is

  • editorManager: Node2D = An exported reference to the editor manager.
  • toolManager : Node2D = An exported reference to the tool manager.
  • gameManager: Node2D = An exported reference to the game manager.
  • entityManager: Node2D = An exported reference to the entity manager.
  • audioManager: Node = An exported reference to the audio manager.
  • cameraManager: Camera2D = An exported reference to the camera manager.
  • editorManagerCanvas: CanvasLayer = An exported reference to the UI for the editor manager.
  • gameManagerCanvas: CanvasLayer = An exported reference to the UI for the game manager.
  • loadingScreen: CanvasLayer = An exported reference to the loading screen overlay used during state transitions.
  • loadingAnimation: AnimationPlayer = An exported reference to the AnimationPlayer that controls the screen wipe animations.
  • mainMenuControl: Control = An exported reference to the main menu control node.
  • loadingTweenTime: float = A value describing how long the loading screen appears/disappears
  • loadingHold: float = A value describing how long the loading screen holds before disappearing.

Important Functions

Name of the most important functions, their parameters, and what they do.

  • func screen_wipe_in() -> void: Plays the screen wipe animation that covers the screen before expensive loading or initialization begins.

  • func screen_wipe_out() -> void: Plays the screen wipe animation that reveals the destination state after loading has completed.

  • func level_setup(levelName: String, newSize: Vector2i) -> void: Creates a new level by initializing the world size, camera, level data, and entering the edit state.

  • func create_bedrock_border() -> void: Creates a border of unbreakable tiles around the buildable grid.

  • func import_level_and_edit() -> void: Imports the selected level into the editor, restores saved properties, and transitions into the edit state.

  • func edit() -> void: Transitions the project into the editor state, restoring editor UI, tools, and enemy positions.

  • func play() -> void: Transitions the project into the play state, saves the current level, initializes gameplay, and loads the playable tilemap.

  • func main_menu() -> void: Transitions the project into the main menu state, hides gameplay/editor systems, and refreshes the level list.

  • func save_tilemap() -> void: Saves the editor tilemap as a PackedScene in the user folder.

  • func load_tilemap() -> void: Loads the saved tilemap from the user folder into the Game Manager.


Future Work / Risks

List and description of upcoming work/risks.

Future Work: None

Risks:

  • None

Miscellaneous Notes

A place for miscellaneous notes pertaining to this system.

  • None

Clone this wiki locally