1

So, I've been making a sort of 2d minecraft, and i need a Phaser method/function to be able to identify each tile by their tileset number,

For example, when i place a tile from a tileset, i require its tile set no.

this.block = this.worldLayer.putTileAtWorldXY(
          6,
          this.worldPoint.x,
          this.worldPoint.y
        );
        this.block.setCollision(true);

that 6 is the tile number of a tile from my tile set, and i need a way to get that number from any tile when i click it, is there anyway to do this?

thanks in advance

Vatsa Pandey
  • 583
  • 2
  • 12

1 Answers1

2

I actually found a method that works at

https://www.html5gamedevs.com/topic/9627-how-to-get-tile-index-property/

use .getTileAt().index

Webdeveloper_Jelle
  • 2,868
  • 4
  • 29
  • 55
Vatsa Pandey
  • 583
  • 2
  • 12