feat: vector-based movement for responsive control and air strafing
Changed from physics-based (accumulate + damping) to vector-based: - Horizontal velocity is SET directly, not accumulated - Press A → cvx = -0.5 (instant, no ramp-up) - Release → cvx = 0 (instant stop, no sliding) - No horizontal damping = precise control - Air strafing: same horizontal speed in air as on ground - Can change direction mid-jump freely - Vertical: gravity + minimal damping (0.99) for natural fall - Jump sets cvy directly, gravity pulls back - move_speed 0.5 (was 0.3), max_vel 2.0 (was 1.0) - Player: move_dir tracks current direction, stop_horizontal() clears velocity - handle_input: calls stop_horizontal when no movement key held 109 tests, 0 warnings, 0 failures
This commit is contained in:
@@ -97,7 +97,7 @@ impl VerletSolver {
|
||||
gravity: 0.04,
|
||||
damping: 0.97,
|
||||
dt: 1.0,
|
||||
max_vel: 1.0,
|
||||
max_vel: 2.0,
|
||||
substeps: 8,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user