diff --git a/app/ecs-components/world.js b/app/ecs-components/world.js index 9a4bf15..1647bc0 100644 --- a/app/ecs-components/world.js +++ b/app/ecs-components/world.js @@ -1,3 +1,3 @@ export default { - world: {defaultValue: -1, type: 'uint16'}, + world: 'uint16', } diff --git a/app/ecs/system.js b/app/ecs/system.js index a348363..b5431bb 100644 --- a/app/ecs/system.js +++ b/app/ecs/system.js @@ -105,7 +105,7 @@ export default class System { this.ecs.removeMany(entities); } - }; + } return new WrappedSystem(); } diff --git a/app/engine/engine.js b/app/engine/engine.js index 69aaa59..7818643 100644 --- a/app/engine/engine.js +++ b/app/engine/engine.js @@ -17,7 +17,7 @@ const players = { Momentum: {}, Position: {x: 50, y: 50}, VisibleAabb: {}, - World: {world: 0}, + World: {world: 1}, Sprite: {image: '/assets/bunny.png'}, }, }; @@ -36,7 +36,7 @@ export default class Engine { ecs.addSystem(CalculateAabbs); ecs.addSystem(UpdateSpatialHash); this.ecses = { - 0: ecs, + 1: ecs, }; this.connections = []; this.connectedPlayers = new Map(); diff --git a/app/engine/engine.test.js b/app/engine/engine.test.js index 05b2183..276c98c 100644 --- a/app/engine/engine.test.js +++ b/app/engine/engine.test.js @@ -6,7 +6,7 @@ import Engine from './engine.js'; test('visibility-based updates', async () => { const engine = new Engine(Server); - const ecs = engine.ecses[0]; + const ecs = engine.ecses[1]; // Create an entity. const entity = ecs.get(ecs.create({ Momentum: {x: 1, y: 0},