From 018ab016b961ca398782053122fd22962be51b97 Mon Sep 17 00:00:00 2001 From: Ruben Rodriguez Date: Wed, 10 Mar 2021 16:38:43 -0500 Subject: [PATCH] Tile-triggered text bubbles --- front/src/Phaser/Game/GameScene.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index 2b553a4..ea8edd5 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -435,9 +435,11 @@ export class GameScene extends Phaser.Scene { // debug code to get a tile properties by clicking on it this.input.on("pointerdown", (pointer: Phaser.Input.Pointer)=>{ //pixel position toz tile position - let tile = this.Map.getTileAt(this.Map.worldToTileX(pointer.worldX), this.Map.worldToTileY(pointer.worldY)); + let tile = this.Map.getTileAt(this.Map.worldToTileX(pointer.worldX), this.Map.worldToTileY(pointer.worldY), false, "override"); if(tile){ - this.CurrentPlayer.say("Your touch " + tile.layer.name); + if (tile.properties["say"] !== undefined){ + this.CurrentPlayer.say(tile.properties["say"]); + } } }); } -- 2.25.1