server reconciliation OK (a little rubberbanding)
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user