Hi,
I would like to set some map position after mouse click.
What is the best way to achieve that?
This is my code:
class MiniMapScene extends Phaser.Scene {
constructor() {
super({ key: ‘miniMap’ });
}
preload() {
console.log('preload method');
this.load.tilemapTiledJSON('map', 'assets/maps/testMaps4.json');
this.load.image('tiles', 'assets/maps/tileGrassDesert.png');
}
create() {
console.log('create method');
var map = this.make.tilemap({ key: 'map', tileWidth: 32, tileHeight: 32 });
var tileset = map.addTilesetImage('tiles');
var layer = map.createLayer(0, tileset, 0, 0); // layer index, tileset, x, y
var cam = this.cameras.main;
cam.zoom = 2;
cam.setBounds(0, 0, 3200, 3200);
this.input.on("pointerdown", function (p)
{
?????
});
}