Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

How do you offset specific frames on a Tilemap?


Blesson
 Share

Recommended Posts

aIjKvro.png

 

 

I'm trying to create an isometric game.

The only trouble is that there's no magical "Hexagonal Grid" with Tilemaps.

As such, I need to offset each tile, but so far none of the properties seem to be doing anything.

Here's what i've tried so far:

map = game.add.tilemap('map', 219, 253);

map.addTilesetImage('tiles');

layer = map.createLayer(0);

layer.resizeWorld();


for(var y = 0; y < map.height; ++y){   

    for(var x = 0; x < map.width; ++x){

        var tile = map.getTile(x, y);

        if (tile){
            tile.Y += Math.random(0,30000);
            tile.worldY += Math.random(0,30000);
            tile.y += Math.random(0,30000);
            tile.centerY += Math.random(0,30000);
        }

        console.log(tile);   


    }
}

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...