ecx 0.0.4

ECX entity-component-system framework

Released 2016-08-20.

To install, run:

haxelib install ecx 0.0.4

See using Haxelib in Haxelib documentation for more information.

Maintainereliasku
Websitehttps://github.com/eliasku/ecx
Current version0.0.4
StatisticsInstalled 37 times
LicenseMIT
Tags ces, component, cross, ecs, entity, system

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