From dcc7f2a686c79fa45f0f77496735b3cd7cb21242 Mon Sep 17 00:00:00 2001 From: GRL Date: Thu, 24 Jun 2021 12:10:44 +0200 Subject: [PATCH 1/3] Fix collides --- front/src/Phaser/Game/GameScene.ts | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index 28c8423a..3d76dd72 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -1170,21 +1170,19 @@ ${escapedMessage} createCollisionWithPlayer() { //add collision layer for (const phaserLayer of this.gameMap.phaserLayers) { - if (phaserLayer.type == "tilelayer") { - this.physics.add.collider(this.CurrentPlayer, phaserLayer, (object1: GameObject, object2: GameObject) => { - //this.CurrentPlayer.say("Collision with layer : "+ (object2 as Tile).layer.name) + this.physics.add.collider(this.CurrentPlayer, phaserLayer, (object1: GameObject, object2: GameObject) => { + //this.CurrentPlayer.say("Collision with layer : "+ (object2 as Tile).layer.name) + }); + phaserLayer.setCollisionByProperty({collides: true}); + if (DEBUG_MODE) { + //debug code to see the collision hitbox of the object in the top layer + phaserLayer.renderDebug(this.add.graphics(), { + tileColor: null, //non-colliding tiles + collidingTileColor: new Phaser.Display.Color(243, 134, 48, 200), // Colliding tiles, + faceColor: new Phaser.Display.Color(40, 39, 37, 255) // Colliding face edges }); - phaserLayer.setCollisionByProperty({collides: true}); - if (DEBUG_MODE) { - //debug code to see the collision hitbox of the object in the top layer - phaserLayer.renderDebug(this.add.graphics(), { - tileColor: null, //non-colliding tiles - collidingTileColor: new Phaser.Display.Color(243, 134, 48, 200), // Colliding tiles, - faceColor: new Phaser.Display.Color(40, 39, 37, 255) // Colliding face edges - }); - } - //}); } + //}); } } From a094e16c1f14647a689bcd23c635a2a94c32d7b3 Mon Sep 17 00:00:00 2001 From: kharhamel Date: Thu, 24 Jun 2021 12:14:28 +0200 Subject: [PATCH 2/3] FIX: solved a menu crash --- front/src/Phaser/Game/GameScene.ts | 6 ------ front/src/Phaser/Menu/MenuScene.ts | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index 28c8423a..4b0d602a 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -498,12 +498,6 @@ export class GameScene extends DirtyScene { this.openChatIcon = new OpenChatIcon(this, 2, this.game.renderer.height - 2) - // FIXME: change this to use the UserInputManager class for input - // FIXME: Comment this feature because when user write M key in report input, the layout change. - /*this.input.keyboard.on('keyup-M', () => { - this.switchLayoutMode(); - });*/ - this.reposition(); // From now, this game scene will be notified of reposition events diff --git a/front/src/Phaser/Menu/MenuScene.ts b/front/src/Phaser/Menu/MenuScene.ts index 4fc58f5d..e5ca5023 100644 --- a/front/src/Phaser/Menu/MenuScene.ts +++ b/front/src/Phaser/Menu/MenuScene.ts @@ -112,8 +112,8 @@ export class MenuScene extends Phaser.Scene { this.gameReportElement = new ReportMenu(this, connectionManager.getConnexionType === GameConnexionTypes.anonymous); showReportScreenStore.subscribe((user) => { - this.closeAll(); if (user !== null) { + this.closeAll(); this.gameReportElement.open(user.userId, user.userName); } }); From ac97cf57724f14fb7b3b096207fab3863ebeec38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Thu, 24 Jun 2021 17:02:57 +0200 Subject: [PATCH 3/3] Fixing a lock when the player is moving from one room to the other This was due to a store not properly unsubscribed when changing rooms. --- front/src/Phaser/Game/GameScene.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index 1c49e774..e6e93b57 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -161,6 +161,7 @@ export class GameScene extends DirtyScene { private createPromiseResolve!: (value?: void | PromiseLike) => void; private iframeSubscriptionList!: Array; private peerStoreUnsubscribe!: () => void; + private biggestAvailableAreaStoreUnsubscribe!: () => void; MapUrlFile: string; RoomId: string; instance: string; @@ -501,7 +502,7 @@ export class GameScene extends DirtyScene { this.reposition(); // From now, this game scene will be notified of reposition events - biggestAvailableAreaStore.subscribe((box) => this.updateCameraOffset(box)); + this.biggestAvailableAreaStoreUnsubscribe = biggestAvailableAreaStore.subscribe((box) => this.updateCameraOffset(box)); this.triggerOnMapLayerPropertyChange(); this.listenToIframeEvents(); @@ -1025,6 +1026,7 @@ ${escapedMessage} this.pinchManager?.destroy(); this.emoteManager.destroy(); this.peerStoreUnsubscribe(); + this.biggestAvailableAreaStoreUnsubscribe(); mediaManager.hideGameOverlay();