2.1 KiB
2.1 KiB
Bevy Game Project Rules
Mission
Build game features fast, but keep code clean enough to survive workshop iteration. Target stack:
- Rust
1.95.0 - Bevy
0.18.1 - 2D first
- local assets in
assets/
Hard rules
- Use Bevy
0.18.1APIs only. - Prefer Bevy built-ins before adding third-party crates.
- Keep compile loop short. Small steps. Small diffs.
- No giant god-systems. Split logic into focused systems and plugins.
- Keep rendering, input, gameplay, UI, and debug concerns separate.
- New feature must include:
- code change
- short reason
- how to run
- what to test manually
- After code edits run, in order:
cargo fmt --allcargo checkcargo clippy --workspace --all-targets --all-features -- -D warnings
- If command fails, quote exact error.
- Do not migrate versions unless asked.
- Do not invent APIs. Check local files first, then docs index in
docs/ai/bevy-source-index.md.
Bevy design rules
- App setup in
main.rsstays thin. - Put features in plugins under
src/when project grows. - Use:
- Components for entity data
- Resources for singleton state
- Events for loose coupling
- States for game flow
- For temporary prototypes, prefer explicit code over macro cleverness.
- Keep startup systems idempotent where possible.
- Use
Nameon important entities in debug-heavy scenes. - Asset paths relative to
assets/.
Architecture defaults
When adding real gameplay, move toward this split:
src/game/core gameplay pluginsrc/player/player components + systemssrc/ui/UI pluginsrc/state/app/game statessrc/debug/debug helpers
Review checklist
Before final answer:
- Is ECS layout sane?
- Are system names specific?
- Are queries minimal?
- Is state transition explicit?
- Is UI separate from gameplay?
- Are commands deferred only where needed?
- Is code Bevy-idiomatic for
0.18.1? - Did you list exact run/test commands?
AI context files
Read when useful:
docs/ai/bevy-quick-reference.mddocs/ai/bevy-project-patterns.mddocs/ai/bevy-debug-playbook.mddocs/ai/workshop-scope.mdai/context/project-context.md