Added pseudo for player directions
This commit is contained in:
parent
3ad50d019d
commit
438255f9b1
@ -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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user