Listen for attack events. TODO: finish anim. handling

This commit is contained in:
2025-02-01 04:30:07 +01:00
parent ac1396304f
commit 99bb1555a0
5 changed files with 29 additions and 2 deletions

View File

@ -32,6 +32,10 @@ gameStore.connection?.on('map:character:leave', (characterId: UUID) => {
mapStore.removeCharacter(characterId)
})
gameStore.connection?.on('map:character:attack', (characterId: UUID) => {
mapStore.updateCharacterProperty(characterId, 'isAttacking', true)
})
gameStore.connection?.on('map:character:move', (data: { characterId: UUID; positionX: number; positionY: number; rotation: number; isMoving: boolean }) => {
mapStore.updateCharacterPosition(data)
// @TODO: Replace with universal class, composable or store