Dynamic Arrays
Please can someone help me...I want to create a dynamic array which will be multi dimensional to hold 2D tiled map levels....Each Level can have several maps...each map being x,y in size....
[Level][MapNum][x][y]
So to read the tile for Level 5, Map 2 at Position 10,10 you would do something like...
MayMap[5][2][10][10].GetTile;
Where should I start, using eith VC++ 2003.net or DevC++....please point me on the right direction....my head is exploding...aaawrrrggghh...
std::vector<std::vector<YourTileObject> > tiles;
I don't recommend going further than this 2-dimensional array to hold the tiles for a single map; you should load levels and maps in and out of memory dynamically to avoid overuse of memory (even a tiled map can still get pretty complex).
Cheers,
Twilight Dragon
I don't recommend going further than this 2-dimensional array to hold the tiles for a single map; you should load levels and maps in and out of memory dynamically to avoid overuse of memory (even a tiled map can still get pretty complex).
Cheers,
Twilight Dragon
Quote:Original post by Enigma
Or boost::multiarray.
Enigma
Ah, oui. Forget what I said and go with Boost if at all possible.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement