Sign in to follow this  
Blesson

How do you offset specific frames on a Tilemap?

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);   


    }
}

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.