This commit is contained in:
cha0s 2024-06-11 00:08:31 -05:00
parent 2d8a966849
commit 12bf7cb65e
4 changed files with 5 additions and 5 deletions

View File

@ -1,3 +1,3 @@
export default {
world: {defaultValue: -1, type: 'uint16'},
world: 'uint16',
}

View File

@ -105,7 +105,7 @@ export default class System {
this.ecs.removeMany(entities);
}
};
}
return new WrappedSystem();
}

View File

@ -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();

View File

@ -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},