
Bevy Genre Racing
Route a Bevy 0.20 race.
Install
npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-genre-racing -g -a claude-code -y- Repository
- thedivergentai/Game-Dev-Agentic-Skills917
- Category
- Engineering
- Updated
- 19d ago
- License
- LGPL-3.0
- Context cost
- Mediumabout 2,300 tokens
- Runs scripts
- No, instructions only
What it does
Route a Bevy 0.20 race. Use when lap and gate index live on the racer, the race clock is one resource, and gate checks run after the clock step in one chain. Keywords: Bevy, Racing, Racer, RaceClock, FixedUpdate, chain, genre.
Bevy Racing (thin router)
Genre router. Domain work lives in the Bevy skills below.
When to use
Load this for laps, splits, and vehicle motion you own.
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
Updateor 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. Do not invent a genre plugin.
Routing
- bevy-game-loop-time-trial - Splits.
- bevy-character-movement - Stand-in motion until a vehicle solver exists.
- bevy-3d-world-building - Track.
Scope
Lap index, gate order, and a kinematic vehicle are components. A rigid-body vehicle solver stays on the physics skill once one is chosen.
Examples
[package]
name = "racing"
version = "0.1.0"
edition = "2021"
[dependencies]
bevy = "0.20"
Gates are entities. The racer stores the next gate index and the lap count. Crossing the last gate increments the lap and records the clock.
#[derive(Component)]
struct Racer {
lap: u32,
next_gate: u32,
gate_count: u32,
}
#[derive(Component)]
struct Gate {
index: u32,
}
#[derive(Resource)]
struct RaceClock {
elapsed: f32,
best_lap: f32,
lap_start: f32,
}
fn tick_clock(time: Res<Time<Fixed>>, mut clock: ResMut<RaceClock>) {
clock.elapsed += time.delta_secs();
}
