aboutsummaryrefslogtreecommitdiff
path: root/apps/fparkan-game/src/main.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-11-26 19:37:09 +0300
committerValentin Popov <valentin@popov.link>2026-11-26 19:37:09 +0300
commit1f366ac0d39a3b1f0b19721ed78936bad1e504dd (patch)
tree431e3cebf1f3c96af086e928b3acdae53df48d1c /apps/fparkan-game/src/main.rs
parentf3d1b4d2aff8e47003626129641c36e44c7fb040 (diff)
downloadfparkan-1f366ac0d39a3b1f0b19721ed78936bad1e504dd.tar.xz
fparkan-1f366ac0d39a3b1f0b19721ed78936bad1e504dd.zip
fix(movement): carry hero walking velocity between ticks
Take both horizontal limits and acceleration from the active Control profile. Apply the measured slope braking after the input update and clear velocity on a blocking wall, teleport or boarding. Keep the terrain limit during geometric sweeps so momentum cannot skip a narrow cliff. In the stock Firing Line window the hero reached the slope, stopped at its foot, backed away, and coasted on key release.
Diffstat (limited to 'apps/fparkan-game/src/main.rs')
-rw-r--r--apps/fparkan-game/src/main.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/apps/fparkan-game/src/main.rs b/apps/fparkan-game/src/main.rs
index b00605ab..a328ccad 100644
--- a/apps/fparkan-game/src/main.rs
+++ b/apps/fparkan-game/src/main.rs
@@ -14055,11 +14055,7 @@ mod tests {
let step = plan_player_motion_with_collision(
&engine,
cockpit,
- PlayerMotion {
- movement: [(x - hx) / distance, (y - hy) / distance * (8.0 / 14.0)],
- delta_seconds: distance.min(8.0 * 0.292) / 8.0,
- ..PlayerMotion::default()
- },
+ player_collision::walk_toward(hero, [x, y], 2.0),
|step| {
app.resolve_player_building_step(step)
.map_err(EngineError::Movement)