aboutsummaryrefslogtreecommitdiff
path: root/test-client/movement.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test-client/movement.ts')
-rw-r--r--test-client/movement.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/test-client/movement.ts b/test-client/movement.ts
index 88c47c33..cd5cc1d5 100644
--- a/test-client/movement.ts
+++ b/test-client/movement.ts
@@ -3,12 +3,13 @@ import { tiles, players, PlayerData } from "./main.ts";
import { V2, normalize, length, sub_v2, lerp_exp_v2_mut } from "./util.ts";
export const PLAYER_SIZE = 0.4;
+export const PLAYER_SPEED = 25;
export function player_movement_update(p: PlayerData, dt: number, input: V2) {
if (length(input) > 0.1) lerp_exp_v2_mut(p.facing, input, dt * 10.)
p.rot = Math.atan2(p.facing.x, p.facing.y)
- p.vel.x += input.x * dt * 25
- p.vel.y += input.y * dt * 25
+ p.vel.x += input.x * dt * PLAYER_SPEED
+ p.vel.y += input.y * dt * PLAYER_SPEED
p.x += p.vel.x * dt
p.y += p.vel.y * dt
collide_player(p, dt)