refactor: synchronizer ticking

This commit is contained in:
cha0s 2019-04-07 16:16:12 -04:00
parent 6b4a12e924
commit f87e9145c5
2 changed files with 4 additions and 4 deletions

View File

@ -158,8 +158,9 @@ const predictionHandle = setInterval(() => {
if (hasSelfEntity()) {
selfEntity.inputState = actionState.toJS();
}
room.tick(elapsed);
worldTime.tick(elapsed);
// Tick synchronized.
stateSynchronizer.tick(elapsed);
// Apply environmental lighting.
stage.removeAllFilters();
let intensity = 0;
if (worldTime.hour >= 21 || worldTime.hour < 4) {

View File

@ -69,8 +69,7 @@ function createMainLoop() {
const now = performance.now();
const elapsed = (now - lastTime) / 1000;
lastTime = now;
room.tick(elapsed);
worldTime.tick(elapsed);
// Tick synchronized.
stateSynchronizer.tick(elapsed);
// Inform entities of the new state.
for (const entity of informables) {