3 releases (breaking)
Uses new Rust 2024
| 0.6.1 | Sep 12, 2025 |
|---|---|
| 0.2.0 | Sep 9, 2025 |
| 0.1.0 | Sep 1, 2025 |
#1615 in Game dev
103 downloads per month
22KB
454 lines
Entity Component System
Examples
use xuko_ecs::{World, Entity};
let mut world = World::new();
struct Monster;
struct Position(i32, i32);
struct Health(i32);
{
let entity = world.spawn();
let components = world.get_entity_mut(entity).unwrap();
// Anything can be used as a component, without any trait implementation.
// As long as the type is `Send + Sync + 'static`
components.add(Monster);
components.add(Position(43, 59));
components.add(Health(5));
}
{
let entity = world.spawn();
let components = world.get_entity_mut(entity).unwrap();
components.add(Monster);
components.add(Position(55, 30));
components.add(Health(3));
}
Dependencies
~2.4–3.5MB
~63K SLoC