Skip to content

score_counter_animation

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

A ScoreCounterAnimation is a short-lived floating number that pops up at the note lane each time the player earns score for a note hit. It shows the base score value and slides upward before fading out. player keeps active instances in base_score_list and removes them when is_finished() returns true.

ScoreCounterAnimation

Construction

ScoreCounterAnimation(PlayerNum player_num, int counter);
Parameter Description
player_num Determines the horizontal position in 2P layouts
counter The score value to display (positive or negative)

Computes the string representation and colour based on whether counter is positive or negative, then starts all animations immediately.

Members

Member Type Description
counter int Score value being displayed
direction int +1 for positive score, -1 for a penalty
fade_animation_1 FadeAnimation* Fade-in
move_animation_1 MoveAnimation* Initial upward slide
fade_animation_2 FadeAnimation* Fade-out
move_animation_2 MoveAnimation* Secondary upward drift during fade-out
move_animation_3 MoveAnimation* Horizontal motion (used for gogo-time colour shifts)
move_animation_4 MoveAnimation* Additional drift
base_color ray::Color Starting colour (orange for positive, grey for negative)
color ray::Color Currently interpolated colour
counter_str string Formatted score string
total_width float Total pixel width of the digit string
margin float Inter-digit spacing
y_pos_list vector<float> Per-digit vertical positions, animated individually

Methods

void update(double current_ms);

Advances all animations and interpolates color.

void draw(float y);

Draws each digit of counter_str at its current animated position, offset by y for 2P.

bool is_finished() const;

Returns true when fade_animation_2 has completed.

Clone this wiki locally