Advertisement Jump to content
Sign in to follow this  
Fantastic Jason

Dynamic Arrays

This topic is 4878 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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...

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!