// 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"]);
+ }
}
});
}