1
0
forked from noxious/client

Worked on creating new characters

This commit is contained in:
2024-05-28 23:46:55 +02:00
parent da728a1fc6
commit 8cd0e9254a
9 changed files with 70 additions and 24 deletions

View File

@ -44,7 +44,7 @@ function onPointerClick(pointer: Phaser.Input.Pointer) {
position.x = worldPoint.x + config.tile_size.y;
position.y = worldPoint.y;
socket.connection?.emit('move', { x: position.x, y: position.y });
socket.getConnection.emit('move', { x: position.x, y: position.y });
}
//Directions for player sprites + animations
@ -57,14 +57,13 @@ function onPointerClick(pointer: Phaser.Input.Pointer) {
} else if (px > 0 && py < 0) {
console.log('top right');
}
}
if (!props.player) {
scene.input.on(Phaser.Input.Events.POINTER_UP, onPointerClick);
}
socket.connection?.on('player_moved', (data) => {
socket.getConnection.on('player_moved', (data: any) => {
console.log('player_moved', data);
if (data.id !== props.player?.id) {