Skip to content

Main Menu

Gaster Chiang edited this page Sep 15, 2026 · 3 revisions

Main Menu

Overview

Screenshot 2026-09-13 at 12 54 21 pm

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.

Backend Structure

MainMenuActions

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

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 MainMenuDisplay and MainMenuActions components.
  • Uses a 1280 × 800 FitViewport.
  • 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.

Display

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 Stack and Table layouts.
  • 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.

Menu Styling

MenuTheme

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.

Assets

The main menu uses the following dedicated assets:

  • images/main_menu_background.png
  • images/main_menu_title_logo.png
  • images/main_menu_button_frame.png

These assets are loaded when MainMenuScreen is created and unloaded when the screen is disposed.

Integration

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.

Testing

The main menu is covered by unit tests:

  • MainMenuDisplayTest
  • MainMenuActionsTest

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 × 800 virtual size across different window dimensions.
  • Main menu actors being correctly removed during disposal.

Table of Contents

Home

Game Engine

Getting Started

Entities and Components

Service Locator

Loading Resources

Logging

Unit Testing

Debug Terminal

Input Handling

UI

Animations

Audio

AI

Physics

Game Screens and Areas

Terrain

Concurrency & Threading

Settings

Encounters
Tutorials and Contextual Help (Team 2)
Cards (Team 6)
Story (Team 6)
Level design, battle system, turn order, spawn (Team 3)
Cards, Save/Load & Bestiary (Team 5)
Rewards and Battle Settlement (Team 7)

Troubleshooting

MacOS Setup Guide

Clone this wiki locally