Crate sparsey

source ·
Expand description

Sparsey is a sparse set-based Entity Component System.

use sparsey::prelude::*;

struct Position(f32);
struct Velocity(f32);

fn main() {
    let mut world = World::default();

    world.create((Position(0.0), Velocity(1.0)));
    world.create((Position(0.0), Velocity(2.0)));|mut positions: CompMut<Position>, velocities: Comp<Velocity>| {
        (&mut positions, &velocities).for_each(|(position, velocity)| {
            position.0 += velocity.0;



  • Manages component storages and handles component grouping.
  • Helper types for describing the layout of component storages within a World.
  • Re-exports the most commonly used items.
  • Query and iterate component views.
  • Resource creation and management.
  • Sparse set-based storages for entities and components.
  • System creation, execution and scheduling.
  • Various utilities used by multiple modules.
  • Manages entities and their associated components.