Jump to content
  • Advertisement
Sign in to follow this  
Fantastic Jason

Dynamic Arrays

This topic is 4812 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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!