Defeat Screen and Return Flow - UQcsse3200/2026-studio-3 GitHub Wiki

Defeat Screen and Return Flow

Team 7 | Post-battle defeat UI

Overview

The defeat screen presents the loss in the same mythic visual language as the victory screen. It shows the DEFEAT title, a short narrative line, and one explicit Return to Menu button.

Defeat screen as it first appears

Broken-wing animation

The screen appears with its wing ornament intact. After a brief pause, the frame gives a short mechanical jolt, the wing breaks away, and small fragments fall and fade. The break is delayed so the player first sees the defeat screen clearly; the motion and sound then underline the transition without preventing a return to the menu.

Defeat screen after the wing breaks

The GIF below shows the intact-to-broken transition from the game capture.

Defeat wing-break animation

Returning to the menu

The player activates Return to Menu by clicking it or pressing Enter or Space. A brief button response plays before the return event is sent. The action is guarded so repeated input cannot trigger multiple transitions.

When a run is active, defeat ends that run and shows the defeat narration before opening the main menu. If there is no active run, the game opens the main menu directly.

Layout and implementation

The artwork uses a fixed reference composition scaled to the game's logical screen height. The background fills the screen; the title, button, frame, and wing layers keep their intended proportions within the composition.

  • EndBattleScreen creates DefeatDisplay and handles the return event and run-state routing.
  • DefeatDisplay draws the themed screen, schedules the wing break and fragments, and handles click and keyboard input.
  • The former generic end-battle click-to-return display is hidden on this screen so that the explicit button owns navigation.

Tests

  • DefeatDisplayTest: screen setup, delayed wing break, return input, duplicate-input protection, disposal.
  • EndBattleScreenTest: defeat return routing for active and inactive runs.

Related pages