All Projects → kutuluk → js13k-ecs

kutuluk / js13k-ecs

Licence: MIT License
A 1kb entity component system, designed for Js13kGames

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to js13k-ecs

Defaultecs
Entity Component System framework aiming for syntax and usage simplicity with maximum performance for game development.
Stars: ✭ 286 (+276.32%)
Mutual labels:  gamedev, ecs, entity-component-system
Entitas Csharp
Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
Stars: ✭ 5,393 (+6996.05%)
Mutual labels:  gamedev, ecs, entity-component-system
Shipyard
Entity Component System focused on usability and speed.
Stars: ✭ 247 (+225%)
Mutual labels:  gamedev, ecs, entity-component-system
Entt
Gaming meets modern C++ - a fast and reliable entity component system (ECS) and much more
Stars: ✭ 6,017 (+7817.11%)
Mutual labels:  gamedev, ecs, entity-component-system
ecs
A dependency free, lightweight, fast Entity-Component System (ECS) implementation in Swift
Stars: ✭ 79 (+3.95%)
Mutual labels:  gamedev, ecs, entity-component-system
Entitas Cpp
Entitas++ is a fast Entity Component System (ECS) C++11 port of Entitas C#
Stars: ✭ 229 (+201.32%)
Mutual labels:  gamedev, ecs, entity-component-system
Godex
Godex is a Godot Engine ECS library.
Stars: ✭ 307 (+303.95%)
Mutual labels:  gamedev, ecs, entity-component-system
Entitas Sync Framework
Networking framework for Entitas ECS. Targeted at turnbased games or other slow-paced genres.
Stars: ✭ 98 (+28.95%)
Mutual labels:  gamedev, ecs, entity-component-system
Flecs
A fast entity component system (ECS) for C & C++
Stars: ✭ 2,201 (+2796.05%)
Mutual labels:  gamedev, ecs, entity-component-system
Uecs
Ubpa Entity-Component-System (U ECS) in Unity3D-style
Stars: ✭ 174 (+128.95%)
Mutual labels:  gamedev, ecs, entity-component-system
polymorph
A fast and frugal entity-component-system library with a focus on code generation and compile time optimisation.
Stars: ✭ 74 (-2.63%)
Mutual labels:  gamedev, ecs, entity-component-system
gdk-for-unity-blank-project
SpatialOS GDK for Unity Blank Project
Stars: ✭ 33 (-56.58%)
Mutual labels:  ecs, entity-component-system
ECS-Phyllotaxis
Learning ECS - 100k Cubes in Phyllotaxis pattern
Stars: ✭ 17 (-77.63%)
Mutual labels:  ecs, entity-component-system
artemis-odb-entity-tracker
🎲 Visual Entity Tracker for ECS library: artemis-odb
Stars: ✭ 27 (-64.47%)
Mutual labels:  ecs, entity-component-system
echo
Super lightweight Entity Component System framework for Haxe
Stars: ✭ 41 (-46.05%)
Mutual labels:  ecs, entity-component-system
ecs
🐰 Entity Component System
Stars: ✭ 62 (-18.42%)
Mutual labels:  ecs, entity-component-system
Learning-Unity-ECS
A bunch of small Unity projects where I explore and learn Unity's new ECS and Job System.
Stars: ✭ 60 (-21.05%)
Mutual labels:  ecs, entity-component-system
apecs
A petite entity component system
Stars: ✭ 17 (-77.63%)
Mutual labels:  ecs, entity-component-system
harmony-ecs
A small archetypal ECS focused on compatibility and performance
Stars: ✭ 33 (-56.58%)
Mutual labels:  ecs, entity-component-system
Entitas-Java
Entity Component System (ECS) in Java 8
Stars: ✭ 37 (-51.32%)
Mutual labels:  gamedev, entity-component-system

js13k-ecs

A 1kb entity component system, designed for js13k.

NPM versionBuild Status

  • Tiny: weighs about one kilobyte gzipped

Install

This project uses node and npm. Go check them out if you don't have them locally installed.

$ npm install js13k-ecs

Then with a module bundler like rollup or webpack, use as you would anything else:

// using ES6 modules
import ecs from 'js13k-ecs';

// using CommonJS modules
var ecs = require('js13k-ecs');

The UMD build is also available on unpkg:

<script src="https://unpkg.com/js13k-ecs/dist/ecs.umd.js"></script>

You can find the library on window.ecs.

Usage

See example folder. Live example

API

ecs

register(...Components)

Registers components for use by the library. Components must be classes or constructor functions. No other requirements are imposed on the components. Note that there is currently a limit of 32 registered components.

process(...systems)

Adds systems for use by the library. Systems must be instances of classes or objects. Systems must implement the update method.

create(id)

Creates the entity with the specified id. If id is not specified, serial numbers starting with 1 are generated and encoded in base36. Returns the created entity.

get(id)

Returns the entity with the specified id or undefined if it is not present.

select(...Components)

Returns a selection of entities that have the specified set of components. The sample is updated real-time and always relevant.

The selector has the length property, which stores the number of entities in the sample and the iterate(fn) method, with which you can loop through all entities.

update(delta)

Successively calls update methods on all systems, passing them the delta parameter. Returns the object that contains the duration of the execution of the systems.

Entity

add(...components)

Adds the components to the entity.

remove(...Components)

Removes components of the Components class from the entity. Calls the destructor method of each component if it is present.

has(Component)

Returns true if the entity has a component of the Component class and false otherwise.

get(Component)

Returns a component of the Component class or undefined if it is not present.

eject()

Removes the entity from all selectors and sets its id to zero. Calls the destructor method of each component if it is present.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].