0.0.14 • Published 3 years ago

dreki v0.0.14

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

🐉 dreki

An Entity-Component System (ecs) library written in Typescript.

🚧 The package is a work-in-progress and might be unstable, use it at your own risks. 🚧

📝 Changelogs

🚀 Install

npm i dreki

📜 Example

import { World, query } from "dreki";
import { not } from "dreki/filters";

class Dead {}

class Position {
  x: = 0;
  y: = 0;
}

const alive = query(not(Dead), Position);

function aliveSystem() {
  for (const [pos] of alive) {
    // do something to alive entities ...
  }
}

const world = World.build()
  .with({ capacity: 200 })
  .stageAfter(Stages.Update, "my_custom_stage")
  .systems("my_custom_stage", aliveSystem)
  .done();

const entity = world.spawn(Position);
const dead_entity = world.spawn(Position, Dead);

setInterval(() => {
  world.update();
}, 1 / 60);

🥳 Getting started

TODO

0.0.10

3 years ago

0.0.11

3 years ago

0.0.12

3 years ago

0.0.13

3 years ago

0.0.14

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.3

3 years ago

0.0.4

3 years ago

0.0.0

3 years ago

1.3.0

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.1

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago