
Bevy Genre Fighting
Bevy genre router for fighting.
Install
npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-genre-fighting -g -a claude-code -y- Repository
- thedivergentai/Game-Dev-Agentic-Skills917
- Category
- Engineering
- Updated
- 19d ago
- License
- LGPL-3.0
- Context cost
- Mediumabout 2,104 tokens
- Runs scripts
- No, instructions only
What it does
Bevy genre router for fighting. Keywords: Bevy, Fighting, genre, ECS, router.
Bevy fighting
Genre router. Domain work lives in the Bevy skills below.
When to use
Load this for local fighting: frame flags, hitboxes as your data, and a round state. Rollback netcode is out of scope.
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. Frame data below is components and one round resource.
Examples
[dependencies]
bevy = "0.20"
Each fighter stores the frame index, advantage, and health. The round clock is a resource. Input, frame advance, and hit resolution share Fighter, so they chain on the fixed step.
#[derive(Component)]
struct Fighter {
frame: u16,
advantage: i16,
health: i32,
}
#[derive(Component)]
struct Hitbox {
active: bool,
damage: i32,
startup: u16,
active_until: u16,
}
#[derive(Resource)]
struct RoundClock {
frames_left: u32,
}
fn boot(mut commands: Commands) {
commands.insert_resource(RoundClock { frames_left: 60 * 99 });
commands.spawn((
Fighter {
frame: 0,
advantage: 0,
health: 10000,
},
Hitbox {
active: false,
damage: 400,
startup: 4,
active_until: 8,
},
));
}
fn open_hitbox(mut fighters: Query<(&Fighter, &mut Hitbox)>) {
for (fighter, mut hitbox) in &mut fighters {
hitbox.active = fighter.frame >= hitbox.startup && fighter.frame < hitbox.active_until;
}
}
