No description
Find a file
Joël Lupien b0b4966435
Merge pull request #3 from Bastczuak/serde_example
-provide an example on how to serialize ecs data.
2021-06-21 11:30:10 -04:00
.github Create FUNDING.yml 2021-03-17 20:19:22 -04:00
examples -provide an example on how to serialize ecs data. 2021-06-21 16:49:46 +02:00
repo Compress 2021-03-18 01:47:08 +01:00
src version bump. 2021-03-17 10:47:25 -04:00
.gitignore prepare 0.1.0 release 2021-01-03 13:27:59 -05:00
Cargo.toml -provide an example on how to serialize ecs data. 2021-06-21 16:49:46 +02:00
LICENSE switch license to apache 2.0 2021-03-27 13:18:06 -04:00
README.md remove line from readme. 2021-03-27 23:24:54 -04:00

Planck ECS Planck ECS

The full ECS (Entity-Component-System) library.

Support an Open Source Developer! ♥️
Become a patron

Composed of two smaller libraries:

Read the documentation.

Why would you use this ECS library?

  • Compatible with all platforms, including WASM!
  • Fast enough on every operation, not just iteration.
  • Minimal amount of dependencies.
  • Small code size.
  • Stable, tested, benchmarked, 100% completed.
  • Ability to handle system errors instead of crashing.
  • Convert both functions and closures into systems!
  • Safe: only 3 unsafe in total. (compared to hundreds in mainstream ECS libraries!)

Usage

Add the following to you Cargo.toml file:

planck_ecs = "*"

Use it like so:

use planck_ecs::*;
fn main() {
    #[derive(Default)]
    pub struct A;

    let mut world = World::default();

    let sys = (|comps: &mut Components<A>, entities: &mut Entities| {
        let entity = entities.create();
        comps.insert(entity, A);
        Ok(())
    }).system();

    let mut dispatch = DispatcherBuilder::new().add_system(sys).build(&mut world);
    dispatch.run_seq(&world).unwrap();
    dispatch.run_seq(&world).unwrap();
    dispatch.run_seq(&world).unwrap();

    assert!(world.get::<Components<A>>().is_ok());
}

For more examples, see the two following repositories' example folders and documentation:

Maintainer Information

  • Maintainer: Jojolepro
  • Contact: jojolepro [at] jojolepro [dot] com
  • Website: jojolepro.com
  • Patreon: patreon