What is an efficient way of storing and loading maps? Right now, my map file is like this:
Code: Select all
tile_sheet.bmp <- tile sheet to load tiles from
x x x x x x x x x x # x coordinates on screen and the # says to the engine "OMG, NO MORE VALUES ON THIS LINE!"
y y y y y y y y y y # y coordinates on screen
fx fx fx fx fx fx fx fx fx fx # x coordinate on tilesheet
fy fy fy fy fy fy fy fy fy fy # y coordinate on tilesheet
t t t t t t t t t t # type of file
w w w w w w w w w w # width of tiles
h h h h h h h h h h # height of tiles
basically, what i do is when i setup the map, i do a for loop:
Code: Select all
for(int i=0;i<map1->x.size();i++)
{
masked_blit(MAP,tile_sheet.bmp,fx[i],fy[i],x[i],y[i]); //something like this
}
My way of loading maps works fine, but is there a more efficient way of doing it? I don't know how good my way will be with very large maps.
Here is url to youtube video:
http://www.youtube.com/watch?v=7anw-W423UA