• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Isometric grid with Tilemap got inaccurate

Petrik33

Member
Well, I don't think you got what I mean from the title so I will explain a little bit:
I am trying to learn how to make isometric game, I used Shaun Spaldings tutorials and even added the object moving to grid working properly BUT my grid, made with tilemap works strangely because it marks the tile I press with my button as the one out of range while for real it is my first grid. So to be clear tile with [0,0] coordiantes in grid is treated as [-1,-1] by gameMaker. Here are some more details:
code for creating grid:

GML:
layer_set_visible("Map",false);

global.theMap=ds_grid_create(MAP_W,MAP_H);

var tileMap=layer_tilemap_get_id("Map");

for(var tX = 0; tX <= MAP_W;tX++)
{
    for(var tY = 0;tY <= MAP_H; tY++)
    {
        var tileMap_data = tilemap_get(tileMap,tX,tY);
        //Format: [Sprite,Z]
        var thisTile = [-1,0];
        thisTile[TILE.SPRITE_FRAME]=tileMap_data;
        thisTile[TILE.Z]=0;
        global.theMap[# tX,tY]=thisTile;
    }
}
And screenshots with the mistake itself and everything else:
So you may see that it reports the left top corner tile as the [-1,-1] coordiantes. Help me plaese, I don't know where can the mistake be or why does it happen. Write here please if you need any other information.
 

Attachments

Top