| name | bevy |
| description | Build Rust games with Bevy: ECS mental model, plugins, schedules, states, assets, 2D sprites, fast iteration (cargo check, dynamic_linking, opt-level), backgrounded cargo run plus game_playtest. Use when the owner mentions Bevy or Cargo.toml depends on bevy.
|
| version | 1.0.0 |
| author | Remedy |
| tags | ["game","bevy","rust","ecs","cargo"] |
| requires | [] |
| tools | ["game_project_info","bash_exec","file_read","file_write","file_edit","repo_search","list_dir","game_playtest","computer_screenshot","vision_decode"] |
| triggers | ["\\bbevy\\b"] |
Bevy (Rust ECS engine)
Bevy compiles slowly and changes API every minor version. Two habits keep
you honest: check the version in Cargo.toml before writing a line, and use
cargo check as the oracle between edits instead of full builds.
Fingerprint
game_project_info(path); file_read Cargo.toml → bevy = "0.x" and
its features. Cargo.lock has the exact patch.
src/main.rs (App builder), src/** plugins, assets/ (default asset
root, relative to the crate).
.cargo/config.toml → linker / -Zshare-generics tweaks already set.
- Rust toolchain:
cargo --version, rustc --version. No cargo → say so;
you can still write code but cannot verify it.
Version discipline. Names moved between releases (SpriteBundle →
Sprite component in 0.15; Camera2dBundle → Camera2d; add_system →
add_systems(Schedule, …) in 0.11; Color::rgb → Color::srgb in 0.14).
When unsure, repo_search the crate source under
~/.cargo/registry/src/*/bevy_*-<ver>/ or read docs.rs/bevy/<ver>. Do not
write from memory for a version you have not checked.
ECS in one breath
Entities are ids; components are plain structs (#[derive(Component)]);
systems are functions whose parameters are queries and resources; resources
are singletons (#[derive(Resource)]); events are queued messages
(#[derive(Event)], EventWriter/EventReader). Systems run inside
schedules: Startup once, Update every frame, FixedUpdate at a fixed
rate (Time<Fixed>). Patterns, ordering, commands, change detection:
references/ecs-patterns.md.
App skeleton
use bevy::prelude::*;
fn main() {
App::new()
.(DefaultPlugins)
.(Startup, setup)
.(Update, (movement, bounce).())
.();
}