Skip to content

score_counter

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

The ScoreCounter displays the player's current score as a large animated number. A squash-and-stretch pulse plays whenever the score increases. Owned by player.

ScoreCounter

Construction

ScoreCounter(int score, bool is_2p);
Parameter Description
score Initial score value (usually 0)
is_2p Adjusts position for the two-player layout

Members

Member Type Description
score int Currently displayed score value
is_2p bool Whether this counter is in the P2 position
stretch TextStretchAnimation* Short scale pulse played on each score increase

Methods

void update_count(int score);

Updates score and restarts the stretch animation. Called whenever player records a judgment.

void update(double current_ms);

Advances the stretch animation.

void draw(float y);

Renders the score digits at the configured position, offset vertically by y in 2P mode, and scaled by the current stretch value.

Clone this wiki locally