server reconciliation OK (a little rubberbanding)

This commit is contained in:
LuckyLaszlo
2022-11-23 10:43:12 +01:00
parent 2b9058ad49
commit 7d5895a6cc
10 changed files with 110 additions and 33 deletions

View File

@@ -1,6 +1,5 @@
import {gc} from "./global.js";
import * as d from "./draw.js";
import {handleInput} from "./handleInput.js";
let actual_time: number = Date.now();
let last_time: number;
@@ -17,9 +16,7 @@ function gameLoop()
actual_time = Date.now();
delta_time = (actual_time - last_time) / 1000;
handleInput(delta_time);
// prediction
// client prediction
gc.ball.moveAndBounce(delta_time, [gc.wallTop, gc.wallBottom, gc.playerLeft, gc.playerRight]);
d.draw();