diff options
Diffstat (limited to 'engine')
-rw-r--r-- | engine/entities/Player.ts | 2 | ||||
-rw-r--r-- | engine/structures/Grid.ts | 3 | ||||
-rw-r--r-- | engine/systems/NetworkUpdate.ts | 2 |
3 files changed, 2 insertions, 5 deletions
diff --git a/engine/entities/Player.ts b/engine/entities/Player.ts index 02dd14e..abe3bb5 100644 --- a/engine/entities/Player.ts +++ b/engine/entities/Player.ts @@ -92,7 +92,7 @@ export class Player extends Entity { const distance = Math.sqrt( Math.pow(center.y - myCenter.y, 2) + Math.pow(center.x - myCenter.x, 2) ); - const clientServerPredictionCenterThreshold = 30; + const clientServerPredictionCenterThreshold = 20; if (distance < clientServerPredictionCenterThreshold) center = myCenter; [ diff --git a/engine/structures/Grid.ts b/engine/structures/Grid.ts index 5f0e053..06bdf4e 100644 --- a/engine/structures/Grid.ts +++ b/engine/structures/Grid.ts @@ -67,9 +67,6 @@ export class Grid implements RefreshingCollisionFinderBehavior { const yBoxes = Math.ceil( this.gridDimension.height / this.cellDimension.height ); - const xBoxes = Math.ceil( - this.gridDimension.width / this.cellDimension.width - ); const translated: Coord2D = { y: center.y - this.topLeft.y, diff --git a/engine/systems/NetworkUpdate.ts b/engine/systems/NetworkUpdate.ts index 524ebf4..02fbd9f 100644 --- a/engine/systems/NetworkUpdate.ts +++ b/engine/systems/NetworkUpdate.ts @@ -32,7 +32,7 @@ export class NetworkUpdate extends System { this.messageProcessor = messageProcessor; this.entityUpdateInfo = new Map(); - this.nextPublishInterval = 0; + this.nextPublishInterval = this.getNextUpdateInterval(); } public update(dt: number, game: Game) { |