From 0281233cbdc76e065a812780de0325fcfbd4e660 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Sun, 25 Jun 2023 18:19:26 -0400 Subject: ghost --- client/src/logic/movement.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'client/src/logic/movement.ts') diff --git a/client/src/logic/movement.ts b/client/src/logic/movement.ts index f03008b..f2a06e7 100644 --- a/client/src/logic/movement.ts +++ b/client/src/logic/movement.ts @@ -1,18 +1,18 @@ import { getMap } from "../map.js" import { Vec2, Map, Rotation, Key, Player, GameState, Tile } from "../types.js" -const MOVE_SPEED = .1 +export const MOVE_SPEED = .08333 -const roundPos = (pos: Vec2): Vec2 => { +export const roundPos = (pos: Vec2): Vec2 => { return {x: Math.round(pos.x), y: Math.round(pos.y)} } -const isStablePos = (pos: Vec2): boolean => { +export const isStablePos = (pos: Vec2): boolean => { let rpos = roundPos(pos) return Math.abs(rpos.x - pos.x) < .05 && Math.abs(rpos.y - pos.y) < .05 } -const getTile = ( +export const getTile = ( map: Map, pos: Vec2, ox: number, @@ -24,7 +24,7 @@ const getTile = ( return map.data[y * map.width + x] } -const getTileFrontWithRot = ( +export const getTileFrontWithRot = ( map: Map, pos: Vec2, rot: Rotation @@ -57,7 +57,7 @@ const getRot = (key: Key): Rotation => { } } -const incrementPos = ( +export const incrementPos = ( pos: Vec2, rot: Rotation, speed: number -- cgit v1.2.3-freya