refactor: set world step time

This commit is contained in:
cha0s 2019-05-03 08:49:03 -05:00
parent fbbe8b00d1
commit 036bf6ad30
2 changed files with 2 additions and 0 deletions

View File

@ -105,6 +105,7 @@ export class App extends decorate(class {}) {
this.simulationHandle = undefined;
this.world = config.doPhysicsSimulation ? new World() : undefined;
this.room.world = this.world;
this.room.world.stepTime = config.simulationFrequency;
// State synchronization.
this.state = undefined;
this.synchronizer = new Synchronizer({

View File

@ -20,6 +20,7 @@ export default class Game {
this.entityPacketSynchronizer = new EntityPacketSynchronizer();
// Room.
this.room = createRoom();
this.room.world.stepTime = config.simulationInterval;
for (const entity of this.room.allEntities()) {
this.onEntityAddedToRoom(entity);
}