awe

Awe is a powerful, fast and simple entity component system inspired by Artemis but taking advantage of Haxe macros
https://github.com/TomBebb/awe/

To install, run:

haxelib install awe 1.0.0 

See using Haxelib in Haxelib documentation for more information.

README.md

Awe

API Reference

Awe is a pure entity component system heavily inspired by Artemis, but taking advantage of Haxe features like macros and conditional compilation.

Basic ECS principles

An entity represents an individual thing in the world, but does not actually store any data by itself - this is simply an integer that uniquely identifies an entity.

A component is a small, composable piece of data that can be stored about an entity.

A system is a kind of object that performs operations on entities with certain component combinations.

More information is on the t-machine wiki.

Making the World

The World is the what encapsulates all the components and systems contained in the project. To construct it, you call World.build(...) with the entities and systems you want it to have.

` haxe var world = World.build({

systems: [new InputSystem(), new MovementSystem(), new RenderSystem(), new GravitySystem()],
components: [Input, Position, Velocity, Acceleration, Gravity, Follow],
expectedEntityCount: ...

});

Making Entities
---------------

An `Entity` represents a single thing in the `World`. To construct this, you need to
construct an `Archetype` by calling `Archetype.build(...)` with the components that
compose it.

``` haxe
var playerArchetype = Archetype.build(Input, Position, Velocity, Acceleration, Gravity);
var player = world.createEntityFromArchetype(playerArchetype);

Types of component

@Packed

This is a component that can be represented by bytes, thus doesn't have any fields whose type is not primitve.

@Empty

This is a component has no fields, so does not need to be be stored or retrieved, just checked for.

Regular

This is just a regular component.

Compiler flags

These can be passed to haxe by adding '-D flag' to your 'build.hxml' or equivalent.

debug

This prints extra information during compilation.

nopack

This forces Awe's macro system to not pack components.

Contributors
tombebbington
Version
1.0.0
Published
3 months ago
License
BSD

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