Changed values for smoother movement

This commit is contained in:
Dennis Postma 2025-02-06 14:07:46 +01:00
parent 765a0468bc
commit 4992ef69d4
2 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ import TeleportService from '#services/characterTeleportService'
export default class CharacterMove extends BaseEvent { export default class CharacterMove extends BaseEvent {
private readonly characterService = CharacterService private readonly characterService = CharacterService
private readonly MOVEMENT_CANCEL_DELAY = 100 private readonly MOVEMENT_CANCEL_DELAY = 250
private movementTimeouts: Map<string, NodeJS.Timeout> = new Map() private movementTimeouts: Map<string, NodeJS.Timeout> = new Map()
public listen(): void { public listen(): void {

View File

@ -7,7 +7,7 @@ type Position = { positionX: number; positionY: number }
export type Node = Position & { parent?: Node; g: number; h: number; f: number } export type Node = Position & { parent?: Node; g: number; h: number; f: number }
class CharacterMoveService extends BaseService { class CharacterMoveService extends BaseService {
private readonly MOVEMENT_DELAY_MS = 260 private readonly MOVEMENT_DELAY_MS = 200
private readonly MAX_PATH_LENGTH = 20 // Limit maximum path length private readonly MAX_PATH_LENGTH = 20 // Limit maximum path length
private readonly DIRECTIONS = [ private readonly DIRECTIONS = [