ecx

ECX entity-component-system framework
https://github.com/eliasku/ecx

To install, run:

haxelib install ecx 0.0.4 

See using Haxelib in Haxelib documentation for more information.

README.md

ecx

Lang Version Dependencies License

Build Status Build Status

ECX is Entity Component System framework for Haxe

System

Injection

For example we need to inject TimeSystem system to our MovementSystem

class MovementSystem extends System {
    var _time:Wire<TimeSystem>;
    ...
    override function update() {
        var dt = _time.dt;
        ...
    }
}

Family

For example we need to track all active(live) entities with components: Transform, Node and Renderable

class MovementSystem extends System {
    var _entities:Family<Transform, Node, Renderable>;
    ...
    override function update() {
        // Note: typeof _entities is Array<Entity>
        for(entity in _entities) {
            // only entities with required component will be displayed
            trace(entity.id);
        }
    }
}

EntityView

EntityView is the utility class. It provides shortcut to edit entity using object-wrapper.

System Flags

  • IDLE: System doesn't override update method. Should not be updated.
  • CONFIG: System is defined with @:config meta. This system is just configurator. It will be deleted after World initialization phase.
  • PROCESSOR: System has at least one entity Family to process.

Component

World

Initialization

var config = new WorldConfig([...]);
var world = Engine.initialize().createWorld(config, ?potCapacity);

CTTI

ClassMacroTools

RTTI

TypeManager

TODO

  • List of entities should be target-optimized EntityVector
  • CBitArray target-optimized underlying data
  • Examples
  • Unit tests
  • README
Contributors
eliasku
Version
0.0.4
Published
1 year ago
License
MIT

All libraries are free

Every month, more than thousand developers use haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on Github!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on Github