bevy-ecs-composition

Installation
SKILL.md

Bevy ECS composition

When to use

Load this when gameplay data should be split across small components and systems, instead of one type that owns everything. The Quick Start ECS page is the source for the names below.

ECS shape

  • Components are Rust structs that derive Component. The ECS page splits Person and Name so more than one kind of entity can carry a name.
  • Entities are spawned with Commands in a Startup system. The page spawns a tuple of components: commands.spawn((Person, Name(...))).
  • Systems are functions. Query<&Name, With<Person>> reads names on entities that also have Person. Query<&mut Name, With<Person>> writes. Register with add_systems.
  • Schedule: Startup runs once. Update runs afterward. Systems run in parallel unless you call .chain(). The page chains update_people before greet_people and leaves an unrelated system outside the chain.

Use the tuple spawn the ECS page shows. Check the ECS docs for a Bundle trait before writing a bundle macro.

Coming from Godot

Installs
4
GitHub Stars
850
First Seen
3 days ago