diff options
Diffstat (limited to '')
-rw-r--r-- | client/src/logic/movement.ts | 12 |
1 files changed, 6 insertions, 6 deletions
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 |