Main Menu & End Screens

Status: Designed Author: user + game-designer Last Updated: 2026-03-28 System Index: #18 — Vertical Slice, Presentation Layer

Overview

The Main Menu is the game's entry point — display name input, connect to server, and navigate to lobby. The end screens (Victory and Game Over) display run results and offer a path back to menu or lobby. These are simple, low-complexity UI screens that bookend the gameplay loop.

Player Fantasy

Main Menu: "I'm ready to play." Clean, fast, no obstacles between opening the game and joining friends.

Victory: "We did it!" A satisfying payoff after a tense boss fight. Brief celebration before the next run.

Game Over: "So close." Acknowledges the loss without punishing. Quick path back to try again.

Detailed Design

┌──────────────────────────────────┐
│                                  │
│       CO-OP DECKBUILDER          │
│       [game title art]           │
│                                  │
│  Your Name: [__________]         │
│                                  │
│  Server: [auto / custom IP]      │
│                                  │
│  [PLAY]                          │
│                                  │
│  [SETTINGS]    [QUIT]            │
│                                  │
└──────────────────────────────────┘
ElementBehavior
Name inputPersisted locally (user://settings.cfg). Pre-filled on return. 1-20 characters.
Server fieldDefault: connects to known server address. Optional: manual IP for LAN/dev.
PLAYConnects to server, transitions to Lobby (Join/Create screen).
SETTINGSOpens settings overlay (V1: volume only, placeholder for more).
QUITExits game (desktop). Hidden on web.

Victory Screen

┌──────────────────────────────────┐
│                                  │
│          ✦ VICTORY ✦             │
│                                  │
│   Boss Defeated!                 │
│                                  │
│   Run Stats:                     │
│   Encounters: 7                  │
│   Cards Collected: 6             │
│   Players: Alice, Bob, Charlie   │
│                                  │
│   [PLAY AGAIN]    [MAIN MENU]    │
│                                  │
└──────────────────────────────────┘

Game Over Screen

┌──────────────────────────────────┐
│                                  │
│          DEFEATED                │
│                                  │
│   Reached: Node 5 / 8           │
│                                  │
│   Run Stats:                     │
│   Encounters: 4                  │
│   Cards Collected: 3             │
│   Players: Alice, Bob            │
│                                  │
│   [TRY AGAIN]     [MAIN MENU]   │
│                                  │
└──────────────────────────────────┘

Run Stats (both screens)

StatSource
Encounters completedRunData.encounter_count
Cards collecteddeck.size() - 10 per player (starter deck = 10)
PlayersRunData.players display names
Reached node (Game Over)RunData.current_node_index / map.layer_count

Button Behavior

ButtonAction
PLAY AGAIN / TRY AGAINReturn to Lobby (room stays active, same players). Host can start a new run.
MAIN MENUDisconnect from server, return to Main Menu.

States and Transitions

MAIN_MENU → PLAY → connect to server → LOBBY
VICTORY / GAME_OVER → PLAY AGAIN → LOBBY (same room)
VICTORY / GAME_OVER → MAIN MENU → disconnect → MAIN_MENU

Interactions with Other Systems

SystemDirectionInterface
Game State ManagerReceivesTransitions to Victory/GameOver state with RunData
Networking LayerCallsMain Menu initiates server connection. End screens can disconnect.
Lobby SystemNavigates toPLAY and PLAY AGAIN navigate to lobby
Settings SystemOpens overlaySETTINGS button (future)

Formulas

None.

Edge Cases

CaseResolution
Empty name fieldPLAY button disabled. Minimum 1 character required.
Server unreachableShow "Cannot connect to server. Check your connection." Retry option.
PLAY AGAIN but room was closed (all others left)Create a new room automatically. Player is host.
Web build: no QUIT buttonHide QUIT on web exports. Detected via OS.has_feature("web").
Return to menu after disconnectClean up connection state. Fresh start.

Dependencies

Upstream

SystemDependency TypeInterface
Game State ManagerHardProvides RunData for end screen stats
Networking LayerHardConnection management

Downstream

SystemDependency TypeInterface
Lobby SystemHardNavigates to lobby
Settings SystemSoftOpens settings overlay (future)

Tuning Knobs

KnobDefaultSafe RangeAffects
default_server_addressConfigurableWhere clients connect
name_max_length2010-30Name display

Acceptance Criteria

#CriterionVerification
1Main menu loads with name input and Play buttonVisual test: launch game, assert menu elements present
2Play connects to server and transitions to lobbyIntegration test: click Play, assert connection + lobby scene
3Name persists between sessionsIntegration test: set name, quit, relaunch, assert name pre-filled
4Victory screen shows correct run statsIntegration test: complete run, assert encounter count and player names correct
5Game Over shows progress (node reached)Integration test: die at node 5, assert "Reached: Node 5 / 8"
6Play Again returns to lobby with same roomIntegration test: click Play Again, assert lobby with same players
7Main Menu disconnects and returns to titleIntegration test: click Main Menu, assert disconnected + title screen
8Server unreachable shows errorIntegration test: invalid server address, assert error message
Built with LogoFlowershow