Skip to content

Movement and Sprint

Dominik Burger edited this page Jun 10, 2026 · 4 revisions

Movement and Sprint [CURRENT]

Top-down movement at BASE_SPEED (200px/s), with per-axis tile collision (slide along walls). Sprint — move faster while stamina lasts — via hold Shift (keyboard), pushing the on-screen joystick to its edge (touch), or pushing the gamepad stick fully — all three work in both single-player and multiplayer. Movement is server-authoritative in both modes now (SP runs a solo server round): the sprint flag rides the move input, the server integrates speed + stamina and broadcasts it, and the client renders snapshots. Shares the pure helpers in src/engine/movement.js.

Rule Value
Sprint speed 1.6× base (320px/s)
Stamina 0–100, shown as a HUD bar
Drain (sprinting) 26/s → ~3.8s burst from full
Regen (not sprinting) 28/s — recovers while walking or idle, even mid-combat (~3.6s to refill)
Terrain speed uniform — biomes no longer modify movement speed (per-biome multipliers removed 2026-06-09)
Restart threshold once empty, must regen to 16 before sprinting again (no sub-second flicker)

Tuned for the large map (GP-4): ~52% sprint uptime so traversal isn't stop-and-go. All values are tunable in GAME.SPRINT.

Clone this wiki locally