Skip to content

game_over

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

The game over screen is shown when the player's session limit is reached. It plays an advertisement jingle if not logged in (always), animates a curtain reveal and "Game Over" text bounce, then fades to black and returns to the title screen.

GameOverScreen

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

Members

Member Type Description
curtain_pull_out MoveAnimation* (anim ID 1) Slides the curtain and kitsune graphic out from the left
curtain_pull_in MoveAnimation* (anim ID 2) Slides the curtain panels in from the right
kitsune_texture_change TextureChangeAnimation* (anim ID 3) Cycles through kitsune animation frames
text_bounce_down MoveAnimation* (anim ID 4) First downward bounce of the "Game Over" text
text_bounce_up MoveAnimation* (anim ID 5) Upward rebound of the "Game Over" text
text_bounce_down_2 MoveAnimation* (anim ID 6) Second downward settle of the "Game Over" text
fade_out FadeAnimation* (anim ID 7) Fade to black before returning to the title screen
ad_played bool Whether the advertisement jingle sequence has started
voice_played bool Whether the voice clip has played
allnet_indicator AllNetIcon Online/offline status icon
coin_overlay CoinOverlay "Free Play" text overlay

Lifecycle

void on_screen_start() override;

Calls Screen::on_screen_start(), retrieves all animations from tex, starts the kitsune_texture_change animation, and immediately plays the bana_ad sound.

Update

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

Drives the following sequence on each frame:

  1. Once bana_ad finishes playing, sets ad_played, plays the curtain sound effect, starts all curtain and text bounce animations, and plays the jingle music.
  2. Once the text has begun bouncing down (text_bounce_down->attribute > 0), sets voice_played and plays the voice sound clip.
  3. Once jingle finishes and the voice has played, starts the fade_out animation.
  4. Once fade_out finishes, calls on_screen_end and returns Screens::TITLE.

Advances all animations every frame.

Draw

void draw() override;

Draws in the following order:

  1. LOGGED_OUT::BANA_AD — the advertisement background.
  2. GLOBAL::KITSUNE — the kitsune sprite, offset by curtain_pull_out and animated through kitsune_texture_change frames.
  3. GLOBAL::CURTAIN_SIDE — the curtain side piece, offset by both pull animations combined.
  4. Four repeating GLOBAL::CURTAIN tiles filling the screen width, offset by both pull animations combined.
  5. The localised game_over_text texture, displaced by the sum of all three text bounce animation values.
  6. A dark rectangle faded to black by fade_out.
  7. coin_overlay and allnet_indicator.

Clone this wiki locally