diff --git a/front/src/Connexion.ts b/front/src/Connexion.ts index b27be366..18bcd6dd 100644 --- a/front/src/Connexion.ts +++ b/front/src/Connexion.ts @@ -119,6 +119,9 @@ export class Connexion { * @param y */ sharePosition(roomId : string, x : number, y : number){ + if(!this.socket){ + return; + } let messageUserPosition = new MessageUserPosition(this.email, roomId, new Point(x, y)); this.socket.emit('user-position', messageUserPosition.toString()); } diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index 947da7bd..d3abfd15 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -27,7 +27,7 @@ export class GameScene extends Phaser.Scene implements GameSceneInterface{ } //hook initialisation - init(){}; + init(){} //hook create scene create(): void { diff --git a/front/src/Phaser/Player/Animation.ts b/front/src/Phaser/Player/Animation.ts index 3652a8d1..38f2afd3 100644 --- a/front/src/Phaser/Player/Animation.ts +++ b/front/src/Phaser/Player/Animation.ts @@ -13,7 +13,7 @@ export enum PlayerAnimationNames { WalkUp = 'up', WalkRight = 'right', None = 'none', -}; +} export const getPlayerAnimations = (PlayerValue : string): AnimationData[] => { return [{