diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index a5248ff7..734e0f96 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -155,14 +155,14 @@ export class GameScene extends ResizableScene implements CenterListener { private playerName!: string; private characterLayers!: string[]; - constructor(private room: Room, MapUrlFile: string) { + constructor(private room: Room, MapUrlFile: string, customKey?: string|undefined) { super({ - key: room.id + key: customKey ?? room.id }); this.Terrains = []; this.groups = new Map(); this.instance = room.getInstance(); - + this.MapUrlFile = MapUrlFile; this.RoomId = room.id; @@ -517,7 +517,7 @@ export class GameScene extends ResizableScene implements CenterListener { this.simplePeer.unregister(); const gameSceneKey = 'somekey' + Math.round(Math.random() * 10000); - const game: Phaser.Scene = new GameScene(this.room, this.MapUrlFile); + const game: Phaser.Scene = new GameScene(this.room, this.MapUrlFile, gameSceneKey); this.scene.add(gameSceneKey, game, true, { initPosition: { @@ -1220,6 +1220,6 @@ export class GameScene extends ResizableScene implements CenterListener { }); })) } - + }