I was chatting with Falco awhile ago about what would be the best way to load a tilemap.
The way I am currently doing is that I have a fixed 2D array of tiles(100x100), and it loads a number into the ID of the tile, something like this:
while(!map.eof()) { map >> map_t[currentTileX][currentTileY].ID; currentTileX++; if(currentTileX >= width) { currentTileX = 0; currentTileY++; } }But the problem with this is that the map file would have to be something like this:
Code: Select all
1
1
1
2
1
2
2
2
1
So my question is, is there any other way to load a map?
Something like this maybe?:
Code: Select all
1111111111
1112222221
1111111111
But in the mean time, any suggestions would be great!