Repository navigation
Main Menu
The main menu is the primary entry point for The Fall of the Pantheon. It replaces the previous temporary/debug menu with a player-facing interface that follows the game's dark-fantasy pixel-art style.
The main menu currently supports:
- Start a new game
- Open the Load Game flow
- Open the Bestiary integration point
- Open Settings
- Exit the game
The menu uses a fixed virtual resolution so its layout remains consistent across different window sizes.
MainMenuActions listens for events triggered by the main menu and performs the corresponding game actions.
Handled events:
-
start: ends any existing run and opens the Map screen. -
load: reserved for the Save/Load integration. -
bestiary: reserved for the Bestiary integration. -
settings: opens the existing Settings screen. -
exit: exits the game.
Navigation logic is kept separate from the visual menu so MainMenuDisplay only needs to handle presentation and event triggering.
MainMenuScreen is responsible for setting up and displaying the main menu.
Responsibilities:
- Registers the required rendering, resource, entity, and input services.
- Loads the main menu assets.
- Creates the
MainMenuDisplayandMainMenuActionscomponents. - Uses a
1280 × 800FitViewport. - Maintains the same virtual layout across different physical window sizes.
- Unloads menu resources when the screen is disposed.
The previous JSON-based MainMenuUi.json menu has been removed and replaced with the Scene2D-based MainMenuDisplay.
The visual main menu is handled by MainMenuDisplay.
Current frontend behaviour:
- Displays the main menu background.
- Displays the The Fall of the Pantheon title/logo.
- Applies a dark overlay above the background for readability.
- Displays the following buttons:
- New Game
- Load Game
- Bestiary
- Settings
- Exit
- Emits an event when each button is selected.
- Uses Scene2D
StackandTablelayouts. - Uses nearest-neighbour texture filtering to preserve the pixel-art appearance.
- Removes its UI actors when disposed.
The display does not directly change game screens. Instead, it emits events that are handled by MainMenuActions.
MenuTheme provides shared colours, dimensions, and button styling for menu components.
It defines common values such as:
- Button width and height
- Button spacing
- Title spacing
- Screen padding
- Shared menu colour palette
The current palette includes:
- Deep Plum
- Earth Brown
- Burnt Rust
- Dusty Mauve
- Warm Parchment
- Soft Coral
- Muted Brown
MenuTheme.createButtonStyle() creates the interactive button states used by the main menu.
Button states include:
- Normal
- Hover
- Pressed
- Disabled
Using a shared theme allows other menu components, such as Save/Load screens, to reuse the same visual style.
The main menu uses the following dedicated assets:
images/main_menu_background.pngimages/main_menu_title_logo.pngimages/main_menu_button_frame.png
These assets are loaded when MainMenuScreen is created and unloaded when the screen is disposed.
The main menu is designed to provide integration points for other feature teams.
Current integration points include:
-
New Game
- Clears the existing run.
- Opens the Map screen.
-
Load Game
- Emits the Load Game event for Save/Load integration.
-
Bestiary
- Emits the Bestiary event for Bestiary integration.
-
Settings
- Opens the existing Settings screen.
-
Exit
- Uses the existing game exit behaviour.
The previous debug options for directly opening the Map, Shop, or Battle screens have been removed from the player-facing menu.
The main menu is covered by unit tests:
MainMenuDisplayTestMainMenuActionsTest
Test coverage includes:
- Main menu buttons being created in the correct order.
- Each button triggering the correct event.
- New Game clearing the current run and opening the Map.
- Settings opening the Settings screen.
- Exit triggering the existing exit behaviour.
- Load Game and Bestiary remaining isolated integration points.
- Old debug routes not being registered.
- Menu layout maintaining the
1280 × 800virtual size across different window dimensions. - Main menu actors being correctly removed during disposal.