Skip to content

warning_screen

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

The warning screen is played during the attract mode sequence on the title screen.

It is composed of four sub-objects that each handle a distinct piece of the animation, all orchestrated by the top-level WarningScreen class.

WarningScreen

The top-level class that owns and drives all sub-objects.

WarningScreen(double current_ms);

Initialises all sub-objects and starts the overall fade-in animation. current_ms is used to record the start time so the update loop can calculate elapsed time.

void update(double current_ms);

Steps every sub-object forward. Once WarningCharacters reports it is finished, WarningBachiHit begins updating. While characters are still animating, a 566.67 ms delay is observed before the warning_voiceover and bachi_swipe sounds are played (once each). The fade-out animation is started at the same time as the voiceover/swipe sounds, and a MOVIE::BACKGROUND overlay is drawn at the fade-out opacity to transition out of the screen.

void draw();

Draws all layers in order: board → X background → characters → X foreground → bachi hit → fade-out overlay.

bool is_finished();

Returns true when the fade-out animation completes.


Board

Handles the warning box sliding in and settling into place.

Three MoveAnimations run in sequence: move_down starts first, then move_up takes over once move_down finishes, and finally move_center takes over once move_up finishes. The current y_pos is set to whichever animation is currently active.

void draw();

Draws WARNING::WARNING_BOX at the current y_pos.


WarningX

The red "X" graphic that appears on the warning box. It has a background layer (light red) and a foreground layer (red) that scales in.

When the resize animation's attribute exceeds 1, the error sound is played once. The foreground is drawn centered and scaled; the background is drawn at full size with its own fade.

void draw_bg();

Draws WARNING::X_LIGHTRED with the secondary fade applied.

void draw_fg();

Draws WARNING::X_RED centered, scaled by the resize animation, with the primary fade applied.

bool is_finished();

Returns true when all three of its animations (resize, fade, fade 2) are finished.


WarningBachiHit

The drumstick-hit graphic that appears after the characters finish animating.

On the first update call, the bachi_hit sound is played and both animations are started. The bachi graphic (WARNING::BACHI) is drawn at a fixed position once the resize animation has begun; the hit flash (WARNING::BACHI_HIT) is drawn centered and scaled.

bool is_finished();

Returns true when its fade and resize animations are both finished and the sound has played.


WarningCharacters

Animates the two Don-chan characters that appear on the warning box.

Both characters use TextureChangeAnimation to step through their sprite frames. A FadeAnimation (shadow_fade) drives the opacity of the trailing shadow frame for character 1; it starts as soon as the character's frame changes for the first time.

void draw(float fade, float fade_2, float y_pos);
  • fade — main opacity for both characters and their shadow sprites.
  • fade_2 — capped at 0.75, used for the shadow sprites (CHARA_0_SHADOW, CHARA_1_SHADOW).
  • y_pos — vertical offset inherited from Board::y_pos so the characters ride the board.

Character 1's previous frame is drawn at shadow_fade->attribute opacity (ghost/trail effect) before the current frame is drawn at fade opacity. The previous-frame draw is skipped if the frame index is out of the valid range (0–6).

bool is_finished();

Returns true when character 1's TextureChangeAnimation is finished.

Clone this wiki locally