Change how ticking works

This commit is contained in:
2026-09-25 16:13:38 -03:00
parent 213363d0be
commit 5fb23cf404
9 changed files with 169 additions and 92 deletions
+3 -2
View File
@@ -1,4 +1,5 @@
import type { PlayerInfo } from "$/common/protocol.ts";
import { TICK_DELTA } from "$/common/constants.ts";
import type { ClientLevel } from "../level/client_level.ts";
import { Player } from "./player.ts";
@@ -32,8 +33,8 @@ export class RemotePlayer extends Player {
this.pitch = pitch;
}
tick(delta: number) {
const t = Math.min(1, delta * SMOOTHING);
tick() {
const t = Math.min(1, TICK_DELTA * SMOOTHING);
this.x += (this.target_x - this.x) * t;
this.y += (this.target_y - this.y) * t;
this.z += (this.target_z - this.z) * t;