summaryrefslogtreecommitdiff
path: root/test-client/movement.ts
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-09-19 20:41:33 +0200
committermetamuffin <metamuffin@disroot.org>2024-09-19 20:41:40 +0200
commit02af3843b695857e9832434336cf093968f00ff5 (patch)
tree14b0763d1bea8f4f1bc9246320b140dee1dd5508 /test-client/movement.ts
parent8b32c50e1bb2b8c8b00105c13c31b896ebab7f8a (diff)
downloadhurrycurry-02af3843b695857e9832434336cf093968f00ff5.tar
hurrycurry-02af3843b695857e9832434336cf093968f00ff5.tar.bz2
hurrycurry-02af3843b695857e9832434336cf093968f00ff5.tar.zst
update movement code everywhere
Diffstat (limited to 'test-client/movement.ts')
-rw-r--r--test-client/movement.ts3
1 files changed, 2 insertions, 1 deletions
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