Skip to content

Main Menu

Andrew Hernandez edited this page Jun 29, 2026 · 13 revisions

System Summary

This scene holds three distinct but connected parts. The Main Menu Screen, New Level Overlay, and Load Level Overlay.


Connected Systems

**Connecting Systems: **

Related Controls

Bugs

  • None

Feature List / Breakdown of Features

Main Menu

Root Page. Three main parts. The title section which displays the name of the game, the left button panel, and the level panel. The Left button panel has 3 buttons; New Level, Load Level, and Quit. The level panel has an item list to display all loaded levels and allow users to enter a level by selecting it there. Links to New Level Overlay and Load Level Overlay through the buttons.

New Level Overlay

Allows you to name a level and set the height and width of the new level. Two buttons to create the level which brings you to the editor state with that level loaded. The cancel button closes the overlay and brings you back to the main menu.

Import Level Overlay

Allows you to import a level through a file path. A button allows you to open file explorer to select a file to import in. Open brings you to the editor state of the loaded level. Cancel closes the overlay and returns to the main menu.

Load Level List

Displays a grid list of all the levels currently stored in the user's directory, allowing the user to load any level by double clicking on them. This list will only display valid levels, so if any files are missing, it will not appear in the list.


Important Variables

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

  • buttonNewLevel : Button = An example of all references to buttons in the script.

  • overlayNewLevel : ColorRect = A reference to the overlay for creating a new level. Hidden by default.

  • fieldNewLevelName : LineEdit = A reference to the input field for creating a new level.

  • spinBoxNewLevelX : SpinBox = A reference to the input field for setting a new level's horizontal size. Minimum is 2. Also has a Y equivalent.

  • fileExplorer : FileDialog = A reference to a basic file explorer dialog.

  • levelList: GridContainer = A reference to the grid container for the levels.

  • levelListItem: PackedScene = A reference to a packed scene of the level list items.

Important Functions

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

  • func _ready() -> void: Connects all buttons to functions through their pressing signals.

  • func create_new_level() -> void: Sends the level name and world size to Master Manager to create a new level. Creates an error popup if the user doesn't set a world name.

  • func import_level() -> void: Takes the user's specified level path and sends it to the Import Export and Master managers. The level folder is copied to user://Levels/ and then imported. An error popup will notify the user if the selected folder has an invalid structure.

  • func fill_level_list() -> void: Fills the level list with all of the levels in the user directory. Has multiple helper functions for setting levels up for display, getting world size from a file, and getting folder/file validation.


Future Work / Risks

Future Work:

  • Giving the main menu a visual refresh so that there is less white space.

Risks: None


Miscellaneous Notes

  • This is the root page and the project will need to open it first when program is run.

Clone this wiki locally