Fix mobile walk speed — reduce tick interval from 80ms to 30ms for smoother movement

This commit is contained in:
justin committed 2026-05-14 10:24:38 -07:00
1 parent 416c123d20
commit 94791feb3e
1 file changed
+2 -2
+2 -2
View File
@@ -158,7 +158,7 @@ class Game {
══════════════════════════════════════════════════════════ */ ══════════════════════════════════════════════════════════ */
_startWalkLoop() { _startWalkLoop() {
if (this._walkLoop) return; if (this._walkLoop) return;
this._walkLoop = setInterval(() => this._walkTick(), 80); this._walkLoop = setInterval(() => this._walkTick(), 30);
} }
_stopWalkLoop() { _stopWalkLoop() {
@@ -183,7 +183,7 @@ class Game {
const viewH = world.parentElement.offsetHeight || 300; const viewH = world.parentElement.offsetHeight || 300;
const worldW = world.offsetWidth || viewW * 4; const worldW = world.offsetWidth || viewW * 4;
const SPEED = 80; /* px per tick */ const SPEED = 30; /* px per tick */
let dx = 0, dy = 0, dir = ''; let dx = 0, dy = 0, dir = '';
if (this._heldKeys.has('right')) { dx = SPEED; dir = 'right'; } if (this._heldKeys.has('right')) { dx = SPEED; dir = 'right'; }