You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

azt

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

azt

Azt is an ECS library written in Typescript.

0.2.3
latest
Source
npm
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Azt ECS

Azt is an ECS library written in Typescript.

Example

// Create a couple of components.
class PositionComponent extends Component {
    x: number = 0;
    y: number = 0;
}

class RotationComponent extends Component {
    angle: number = 0;
}

// Create a system to operate on components.
class MovementSystem extends System.requires(PositionComponent, RotationComponent) {
    update(dt, entity, [pos, rot]) {
        pos.x += 0.1;
        rot.angle += Math.PI/5;
    }
}

// Set up entity manager and systems.
let manager = new EntityManager();
let system = new MovementSystem(manager);

// Create a new entity.
let entity = manager.createEntity();

// Add components.
manager.setComponent(entity, new PositionComponent());
manager.setComponent(entity, new RotationComponent());

// Or remove.
manager.deleteComponent(entity, PositionComponent);
manager.setComponent(entity, new PositionComponent());

// Completely remove entity.
manager.deleteEntity(entity);

// Run systems. You should do this in a loop.
dt = 1000/60;
system.run(dt);

FAQs

Package last updated on 09 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts