Added pseudo for player directions

This commit is contained in:
Colin Kallemein 2024-05-18 18:15:54 +02:00
parent 3ad50d019d
commit 438255f9b1

View File

@ -46,6 +46,18 @@ function onPointerClick(pointer: Phaser.Input.Pointer) {
socket.socket?.emit('move', { x: position.x, y: position.y }); socket.socket?.emit('move', { x: position.x, y: position.y });
} }
//Directions for player sprites + animations
if (px < 0 && py > 0) {
console.log('down left');
} else if (px < 0 && py < 0) {
console.log('top left');
} else if (px > 0 && py > 0) {
console.log('down right');
} else if (px > 0 && py < 0) {
console.log('top right');
}
} }
if (!props.player) { if (!props.player) {