Skip to content

Workspaces

Alexander Riese edited this page May 11, 2018 · 1 revision

Code to try out the current ECS-API:

entityMgr := ECSEntityManager new.
entity1 := entityMgr createEntity.
comp1 := ECSRepresentationComponent withPosition: 10@10 color: Color red extent: 50@50.  
entityMgr addComponent: comp1 to: entity1.
canvas := ECSCanvasMorph new openInWorld.
system := ECSRenderingSystem withEntityManager: entityMgr drawSurface: canvas.
system update.
entity2 := entityMgr createEntity.
comp2 := ECSRepresentationComponent withPosition: 100@100 color: Color green extent: 30@60.
entityMgr addComponent: comp2 to: entity2.
system update.
Clone this wiki locally