All Projects → adngdb → entity-system-js

adngdb / entity-system-js

Licence: MIT license
ensy - A very simple Entity System for JavaScript

Programming Languages

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

Projects that are alternatives of or similar to entity-system-js

Entitas Csharp
Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
Stars: ✭ 5,393 (+5892.22%)
Mutual labels:  ecs, entity, entity-component
SpaceWar-ECS
A space war game made with ECS and JobSystem in Unity.
Stars: ✭ 26 (-71.11%)
Mutual labels:  ecs, entity, entity-component
Kengine
Entity-Component-System (ECS) with a focus on ease-of-use, runtime extensibility and compile-time type safety and clarity.
Stars: ✭ 417 (+363.33%)
Mutual labels:  ecs, entity
Actors.unity
🚀Actors is a framework empowering developers to make better games faster on Unity.
Stars: ✭ 437 (+385.56%)
Mutual labels:  ecs, entity
Ecs Snake
Simple snake game powered by ecs framework.
Stars: ✭ 41 (-54.44%)
Mutual labels:  ecs, entity
ecs
🐰 Entity Component System
Stars: ✭ 62 (-31.11%)
Mutual labels:  ecs, entity-component
URSA
[DEPRECATED] integrated ECS framework for Unity
Stars: ✭ 30 (-66.67%)
Mutual labels:  ecs, entity
uecs
Micro ECS
Stars: ✭ 30 (-66.67%)
Mutual labels:  ecs, entity
Htframework
Unity HTFramework, a rapid development framework of client to the unity.
Stars: ✭ 179 (+98.89%)
Mutual labels:  ecs, entity
Entitas Cpp
Entitas++ is a fast Entity Component System (ECS) C++11 port of Entitas C#
Stars: ✭ 229 (+154.44%)
Mutual labels:  ecs, entity
ecs
A dependency free, lightweight, fast Entity-Component System (ECS) implementation in Swift
Stars: ✭ 79 (-12.22%)
Mutual labels:  ecs, entity
entitas-python
Entitas ECS implementation in Python.
Stars: ✭ 41 (-54.44%)
Mutual labels:  ecs, entity
Entitas-Redux
An entity-component framework for Unity with code generation and visual debugging
Stars: ✭ 84 (-6.67%)
Mutual labels:  ecs, entity
Entitycomponentsystemsamples
No description or website provided.
Stars: ✭ 4,218 (+4586.67%)
Mutual labels:  ecs, entity
apecs
A petite entity component system
Stars: ✭ 17 (-81.11%)
Mutual labels:  ecs, entity-component
Geotic
Entity Component System library for javascript
Stars: ✭ 97 (+7.78%)
Mutual labels:  ecs, entity
Entia
Entia is a free, open-source, data-oriented, highly performant, parallelizable and extensible Entity-Component-System (ECS) framework written in C# especially for game development.
Stars: ✭ 28 (-68.89%)
Mutual labels:  ecs, entity
ECS-Phyllotaxis
Learning ECS - 100k Cubes in Phyllotaxis pattern
Stars: ✭ 17 (-81.11%)
Mutual labels:  ecs, entity
eo-logger
Isomorphic JavaScript logger based on Elastic Common Schema
Stars: ✭ 21 (-76.67%)
Mutual labels:  ecs
ecs-mesh-workshop
This handy workshop help the customers to quickly launch ECS with service mesh support on top of mixed type of instance in all commercial regions (include China), and also provides hands-on tutorials with best practices. It can be customized easily as per need.
Stars: ✭ 17 (-81.11%)
Mutual labels:  ecs

ensy: Entity System for JavaScript

ensy is a JavaScript implementation of the Entity System model as described by Adam Martin in his blog post series Entity Systems are the future of MMOs.

Component/Entity Systems are an architectural pattern used mostly in game development. A CES follows the Composition over Inheritance principle to allow for greater flexibility when defining entities (anything that's part of a game's scene: enemies, doors, bullets) by building out of individual parts that can be mixed-and-matched. This eliminates the ambiguity problems of long inheritance chains and promotes clean design. However, CES systems do incur a small cost to performance.

— From the Entity Systems Wiki

Installation

This module is available on npm as ensy. It has no dependencies.

npm install --save ensy

Usage

import EntityManager from 'ensy';

let manager = new EntityManager();

// Create a component and add it to the manager.
const PlayerComponent = {
    name: 'Player',
    description: "The player's state",
    state: {
        life: 100,
        strength: 18,
        charisma: 3,
    }
};
manager.addComponent(PlayerComponent.name, PlayerComponent);

// Create a new entity.
const playerId = manager.createEntity(['Player']);

// Update the player's state:
let playerData = manager.getComponentDataForEntity('Player', playerId);
playerData.life = 80;

// Which is equivalent to:
manager.updateComponentDataForEntity('Player', playerId, {
    life: 80,
});

// Which can also be done when creating the entity:
const playerId = manager.createEntity(['Player'], null, {
    Player: {
        life: 80,
    },
});

console.log(playerData);
// { life: 80, strength: 18, charisma: 3 }
}

Documentation

The documentation is available on Read the docs. All methods are well documented and parameters are described.

For an overall explanation of ensy, you can read my blog post ensy - Entity System Reloaded.

Examples

There are examples in the examples directory:

For developers

Install the dependencies with npm install. The source files are in src/. The code uses es6 features, and is compiled to es5 using babel and rollup.

Building the code

$ npm run build

We use rollup and babel to compile the code from es6 to es5, and uglify to minify the source code.

Running tests

$ npm test

To have tests watch your files and re-run when they change:

$ npm run test-w

To run the tests in your browser:

$ npm run test-browser

Building the API documentation

$ npm run build_doc
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].