-
Notifications
You must be signed in to change notification settings - Fork 6
gauge
The Gauge class tracks and displays the player's health/score meter during gameplay. It supports two modes: normal gameplay and dan-mode, each with different fill rules and visual styles. Used by player (owned) and game_dan (shared).
| Value | Description |
|---|---|
NORMAL |
Standard gameplay gauge with difficulty-based scaling |
DAN |
Shared gauge for dan-mode challenges |
Gauge(GaugeMode mode, PlayerNum player_num, int total_notes, int difficulty = 0, int level = 1);| Parameter | Description |
|---|---|
mode |
NORMAL or DAN
|
player_num |
Which player this gauge belongs to; affects texture positioning |
total_notes |
Total note count used to calculate per-note fill amounts |
difficulty |
Song difficulty (0–4); indexes into the gauge lookup table |
level |
Gauge level (1–10) used in NORMAL mode to select clear threshold |
| Member | Type | Description |
|---|---|---|
gauge_length |
float |
Current fill value |
gauge_max |
float |
Maximum possible fill value |
| Member | Type | Description |
|---|---|---|
mode |
GaugeMode |
Controls fill logic and drawing style |
table |
vector<vector<GaugeTable>> |
2D lookup table indexed by [difficulty][level] for fill multipliers |
clear_start |
vector<int> |
Minimum fill required to be in "clear" state per level |
is_clear |
bool |
Whether gauge_length meets the clear threshold |
is_rainbow |
bool |
Whether the gauge is completely full (rainbow state) |
rainbow_start_ms |
double |
Timestamp when the rainbow state began; drives the shimmer animation |
rainbow_frac |
float |
Normalised animation progress for the rainbow shimmer |
previous_length |
float |
Previous frame's fill value; used to trigger the hit animation |
gauge_update_anim |
FadeAnimation* |
Short flash animation played when the gauge changes |
tamashii_fire_change |
TextureChangeAnimation* |
Animates the "tamashii" fire sprite at the gauge head |
rainbow_fade_in |
optional<FadeAnimation*> |
Fade-in animation that plays when the rainbow state is first reached |
visual_length |
float |
DAN mode: smoothly animated fill value, lagging behind gauge_length
|
Per-entry in the lookup table.
| Field | Type | Description |
|---|---|---|
clear_rate |
float |
Gauge fill fraction required to be in clear state |
ok_multiplier |
float |
Fraction of a good fill added for an OK judgment |
bad_multiplier |
float |
Amount subtracted from the gauge on a BAD judgment |
void add_good();
void add_ok();
void add_bad();Adjust gauge_length based on the judgment, the current table entry, and whether gogo-time is active. add_bad() always reduces the gauge. Clamps gauge_length to [0, gauge_max] and updates is_clear and is_rainbow.
void update(double current_ms);Advances gauge_update_anim, tamashii_fire_change, and rainbow_fade_in. In DAN mode, also smoothly interpolates visual_length toward gauge_length.
void draw(float y = 0.0f);Renders the gauge bar, the tamashii fire sprite, and the rainbow overlay when is_rainbow is true. y is an offset applied in 2P layouts.
float get_progress() const;Returns gauge_length / gauge_max (0–1).
bool get_is_clear() const;
bool get_is_rainbow() const;Accessors for the clear and rainbow flags used by player and result/gauge.
Building
libs
- animation
- audio
- config
- filesystem
- global_data
- input
- logging
- ray
- scores
- screen
- script
- song_parser
- text
- texture
- video
- webcam
libs/parsers
objects
objects/game
- player
- background
- gauge
- judgment
- combo
- branch_indicator
- ending_animations
- gogo_time
- fireworks
- song_info
- transition
- result_transition
- judge_counter
- score_counter
- score_counter_animation
- balloon_counter
- drumroll_counter
- kusudama_counter
- drum_hit_effect
- lane_hit_effect
- gauge_hit_effect
- combo_announce
- note_arc
objects/global
objects/title
objects/entry
objects/settings
objects/result
objects/song_select
- player
- navigator
- box_base
- box_song
- box_folder
- neiro
- modifier
- ura_switch
- diff_sort
- search_box
- dan_transition
- genre_bg
- score_history
- song_select_script
scenes