1
0
forked from noxious/client
This commit is contained in:
2024-05-28 21:54:05 +02:00
parent 9ef697d812
commit da728a1fc6
11 changed files with 242 additions and 85 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.socket?.emit('move', { x: position.x, y: position.y });
socket.connection?.emit('move', { x: position.x, y: position.y });
}
//Directions for player sprites + animations
@ -64,7 +64,7 @@ if (!props.player) {
scene.input.on(Phaser.Input.Events.POINTER_UP, onPointerClick);
}
socket.socket?.on('player_moved', (data) => {
socket.connection?.on('player_moved', (data) => {
console.log('player_moved', data);
if (data.id !== props.player?.id) {