From 02af3843b695857e9832434336cf093968f00ff5 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Thu, 19 Sep 2024 20:41:33 +0200 Subject: update movement code everywhere --- test-client/movement.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test-client') diff --git a/test-client/movement.ts b/test-client/movement.ts index 62846edf..7d395396 100644 --- a/test-client/movement.ts +++ b/test-client/movement.ts @@ -37,7 +37,8 @@ export interface MovementBase { } export function update_movement(p: MovementBase, dt: number, direction: V2, boost: boolean) { - if (length(direction) > 0.1) lerp_exp_v2_mut(p.facing, direction, dt * 10.) + if (length(direction) > 0.05) lerp_exp_v2_mut(p.facing, direction, dt * 10.) + if (length(direction) < 0.5) direction.x = direction.y = 0 p.rot = Math.atan2(p.facing.x, p.facing.y) boost &&= length(direction) > 0.1 p.boosting = boost && (p.boosting || p.stamina >= 1) && p.stamina > 0 -- cgit v1.2.3-70-g09d2