# Bevy Genre Racing

Route a Bevy 0.20 race.

- Repository: https://github.com/thedivergentai/Game-Dev-Agentic-Skills (917 stars)
- Category: Engineering
- License: LGPL-3.0
- Last updated: 2026-10-16
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-genre-racing -g -a claude-code -y`
Codex: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-genre-racing -g -a codex -y`
Cursor: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-genre-racing -g -a cursor -y`
Gemini CLI: `npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-genre-racing -g -a gemini-cli -y`

## Description

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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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 `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. Do not invent a genre plugin.

## Routing

- [bevy-game-loop-time-trial](https://github.com/thedivergentai/Game-Dev-Agentic-Skills/blob/main/skills/bevy-game-loop-time-trial/SKILL.md) - Splits.
- [bevy-character-movement](https://github.com/thedivergentai/Game-Dev-Agentic-Skills/blob/main/skills/bevy-character-movement/SKILL.md) - Stand-in motion until a vehicle solver exists.
- [bevy-3d-world-building](https://github.com/thedivergentai/Game-Dev-Agentic-Skills/blob/main/skills/bevy-3d-world-building/SKILL.md) - 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

```toml
[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.

```rust
#[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();
}

The rest: https://github.com/thedivergentai/Game-Dev-Agentic-Skills/blob/HEAD/skills/bevy-genre-racing/SKILL.md
