Skip to content
Anthony Samms edited this page Jun 2, 2026 · 1 revision

The entry screen is where players join the game, choose a game mode, and optionally select a costume before proceeding to song select. It manages a three-phase state machine — side selection, mode selection, and costume selection — and coordinates up to two independent player slots with their own drums, character models, and nameplates.

The screen is constructed with the name "entry", which the base Screen class uses to load the correct textures and sounds from the active skin.

EntryState

An enum tracking which phase the screen is currently in.

Value Description
SELECT_SIDE Players are choosing which side to join on (1P, 2P, or cancel)
SELECT_MODE Players navigate the mode carousel (Game, Practice, Costume, Settings)
SELECT_COSTUME A player has opened the costume menu

EntryScreen

Inherits from Screen. Constructed with the screen name "entry".

Members

Member Type Description
state EntryState Current screen phase
players vector<EntryPlayer> Up to two active player slots
box_manager BoxManager Mode-selection carousel shared across both players
script EntryScript Lua script interface for skin-driven drawing
entry_overlay EntryOverlay banapass / payment / camera indicators
coin_overlay CoinOverlay Global coin display
allnet_icon AllNetIcon Online connectivity indicator
timer unique_ptr<Timer> 60-second idle countdown

Lifecycle

void on_screen_start() override;

Calls Screen::on_screen_start() to load skin assets, starts background music, initialises the EntryScript, and enters SELECT_SIDE state. The cloud animations for both player slots are started here.

Screens on_screen_end(Screens next_screen) override;

Delegates to Screen::on_screen_end, which unloads all sounds, music, and textures.

Update

std::optional<Screens> update() override;

The main loop. Each frame it:

  1. Calls Screen::update() for first-frame initialisation.
  2. Advances the script and entry_overlay animations.
  3. Calls handle_input().
  4. Updates all active EntryPlayer instances, the box_manager, coin_overlay, allnet_icon, and timer.
  5. If the timer expires, returns Screens::TITLE.
  6. If a mode box is confirmed and its transition animation completes, returns the target Screens value for that mode.
  7. If no players are joined and the back key is pressed from SELECT_MODE, returns to SELECT_SIDE.

Returns std::nullopt while the screen is still active.

Input Handling

void handle_input(); // private dispatcher

Routes input to the correct handler based on state.

void handle_input_side_select();

Reads L-Don / L-Kat for 1P and R-Don / R-Kat for 2P. A Don press on an unjoinable side plays a drum sound and adds an EntryPlayer for that side, advancing to SELECT_MODE once at least one player has joined. A Kat press plays a kat drum sound. Pressing the back input with no players joined returns to Screens::TITLE.

void handle_input_mode_select();

Delegates left/right navigation and confirm/back inputs to each EntryPlayer, which forwards them to the BoxManager. When a player confirms the Costume box, state transitions to SELECT_COSTUME. When a player confirms any other box, the BoxManager starts its fade-out animation and the target screen is queued.

void handle_input_costume_select();

Delegates input to the EntryPlayer whose costume menu is open. On confirmation or cancellation, the costume menu is closed and state returns to SELECT_MODE.

Draw

void draw() override;

Renders in the following order:

  1. script->draw_background() — Lua-driven background with flickering lights.
  2. script->draw_side_select() — side-select panel art.
  3. script->draw_side_select_buttons() — 1P / Cancel / 2P button highlights.
  4. For each player: drum sprite, cloud animations, and Chara3D model.
  5. box_manager->draw() — the mode carousel, visible once at least one player has joined.
  6. For each player in SELECT_COSTUME: costume_menu->draw().
  7. For each player: nameplate->draw() and indicator->draw().
  8. script->draw_footer() — bottom bar showing join prompts.
  9. entry_overlay->draw(), coin_overlay->draw(), allnet_icon->draw(), timer->draw().

Clone this wiki locally