--- name: bevy-genre-rhythm description: "Bevy 0.20 rhythm router: chart notes, a song clock, and hit windows as ECS data. Use when routing a rhythm game. Keywords: Bevy, Rhythm, chart, hit window, ECS, router." --- # Bevy Rhythm (thin router) Genre router. Domain work lives in the Bevy skills below. ## When to use Load this for chart time and hit windows aligned to audio. ## ECS shape - **Components** hold the genre's per-entity flags as plain data. This file does not name new engine types. - **Resources** hold run-wide counters (score, wave index, seed) via bevy-data-resources. - **Systems** read those components on `Update` or the fixed timestep from bevy-master. Order them with `.chain()` when a later system must see the result. - **Schedule:** gameplay mode changes go through bevy-state-machines. This file registers only the chart clock and the hit judge. ## Routing - [bevy-audio-systems](https://github.com/thedivergentai/Game-Dev-Agentic-Skills/blob/main/skills/bevy-audio-systems/SKILL.md) - Music playback. - [bevy-input-handling](https://github.com/thedivergentai/Game-Dev-Agentic-Skills/blob/main/skills/bevy-input-handling/SKILL.md) - Hits. - [bevy-game-loop-time-trial](https://github.com/thedivergentai/Game-Dev-Agentic-Skills/blob/main/skills/bevy-game-loop-time-trial/SKILL.md) - Score time. ## Scope Chart notes, the song clock, and hit windows live here. Playback, input devices, and score presentation stay in the skills linked above. | Call | Owner here | Leave to the linked skill | | --- | --- | --- | | Song time advances | `ChartClock` from `Time::delta_secs` | Playback in bevy-audio-systems | | Lane press inside the tight window | `ChartNote.grade = 2` | Device mapping in bevy-input-handling | | Lane press inside only the wide window | `ChartNote.grade = 1` | Score presentation in bevy-game-loop-time-trial | ```toml [dependencies] bevy = "0.20" ``` ```rust #[derive(Component)] struct ChartNote { hit_at: f32, lane: u8, judged: bool, } #[derive(Resource)] struct HitWindow { perfect: f32, good: f32, } #[derive(Resource, Default)] struct ChartClock(f32); fn advance_chart(time: Res