tune(playfield): ona diagonal amb easing i cap brillant

This commit is contained in:
2026-05-21 22:06:02 +02:00
parent 07985228b2
commit 5c8a583e24
3 changed files with 76 additions and 42 deletions
+6 -8
View File
@@ -30,19 +30,17 @@ namespace Graphics {
private:
struct Line {
Vec2 start; // top (verticals) o left (horitzontals)
Vec2 end; // bottom (verticals) o right (horitzontals)
float brightness; // base (GRID_BRIGHTNESS o SUBGRID_BRIGHTNESS)
int slot; // posició a la timeline 0..total_slots-1
Vec2 start; // top (verticals) o left (horitzontals)
Vec2 end; // bottom (verticals) o right (horitzontals)
float brightness; // base (GRID_BRIGHTNESS o SUBGRID_BRIGHTNESS)
float spawn_time_s; // moment de naixement (verticals i horitzontals tenen ritmes independents)
};
void buildLines();
[[nodiscard]] auto computeLineProgress(int slot) const -> float;
[[nodiscard]] auto computeLineProgress(const Line& line) const -> float;
Rendering::Renderer* renderer_;
std::vector<Line> lines_; // verticals primer (ordenats per x), després horitzontals (ordenats per y)
int total_slots_{0};
float spawn_interval_s_{0.0F}; // calculat a buildLines() perquè la última línia acabi a TOTAL_ANIMATION_DURATION_S
std::vector<Line> lines_;
float elapsed_s_{0.0F};
};