refactor: synchronizer ticking
This commit is contained in:
parent
6b4a12e924
commit
f87e9145c5
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user