Puzzle Platformer. Entity Component System / TypeScript Demo.
npm install
npm run start //development
npm run build //productionOpen Browser at http://127.0.0.1:9000?debug
- Spritesheet packing and optimization.
- 2D Batched renderering.
- 2D Physics.
- Audio
- Animation System
- Particle System
Creating system example:
class LogicSystem extends ProcedureSystem {
private readonly components: DataView<LogicComponent>
constructor(manager: EntityManager, options){
this.components = manager.aquireDataView(LogicComponent)
}
execute(context: IUpdateContext){
for(let i = 1; i <= this.components.data.length; i++)
this.components.data.get(i).updateLogic()
}
}
const manager = new EntityManager()
manager.registerSystem(LogicSystem, options)Creating entity example:
const entity = manager.createEntity()
manager.createComponent(entity, Transform2D, { position: [100, 200] })
manager.createComponent(entity, Material, { texture: 'assets/texture.png' })
manager.createComponent(entity, Sprite2D)
manager.createComponent(entity, LogicComponent, { value: 112 })