@javelin/ecs
Javelin is an implementation of ECS, a popular architecture for building games with dynamic entity behavior.
Join us on Discord!
Docs
Visit https://javelin.dev
Installation
npm i @javelin/ecs
Quick Start
import * as j from "@javelin/ecs"
let Pos = j.value({x: "number", y: "number"})
let Vel = j.value({x: "number", y: "number"})
let app = j
.app()
.addInitSystem(world => {
let origin = {x: 0, y: 0}
world.create(j.type(Pos, Vel), origin, {x: 0, y: -1})
})
.addSystem(world => {
world.query(j.type(Pos, Vel)).each((entity, pos, vel) => {
pos.x += vel.x
pos.y += vel.y
})
})
.step()