From 1f49a2f0731a6424b59e5dcb33ec6272264c010a Mon Sep 17 00:00:00 2001 From: cha0s Date: Sat, 23 Mar 2019 23:07:30 -0500 Subject: [PATCH] refactor: no physics or extrapolate on client --- client/index.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/client/index.js b/client/index.js index c141961..0946691 100644 --- a/client/index.js +++ b/client/index.js @@ -3,14 +3,12 @@ import {EntityList} from '@avocado/entity'; import {ActionRegistry} from '@avocado/input'; import {Container, Renderer, ShapeView} from '@avocado/graphics'; import {shapeFromJSON} from '@avocado/physics'; -import {World} from '@avocado/physics/dummy'; import {StateSynchronizer} from '@avocado/state'; import {Animation} from '@avocado/timing'; const stage = new Container(); const entityList = new EntityList(); -entityList.world = new World(); const stateSynchronizer = new StateSynchronizer({ entityList, }); @@ -69,16 +67,16 @@ const messageHandle = setInterval(() => { } }, 1000 / 60); // Prediction. -let lastTime = performance.now(); -const predictionHandle = setInterval(() => { - const now = performance.now(); - const elapsed = (now - lastTime) / 1000; - lastTime = now; - if (hasSelfEntity()) { - selfEntity.inputState = actionState.toJS(); - } - entityList.tick(elapsed); -}, 1000 / 80); +// let lastTime = performance.now(); +// const predictionHandle = setInterval(() => { +// const now = performance.now(); +// const elapsed = (now - lastTime) / 1000; +// lastTime = now; +// if (hasSelfEntity()) { +// selfEntity.inputState = actionState.toJS(); +// } +// entityList.tick(elapsed); +// }, 1000 / 80); // State updates. let dirty = false; function onMessage({type, payload}) {