2
\$\begingroup\$

I was looking around at this site about eight months ago and wish I saved the location of this topic but I was wondering the different map rendering styles that you can do in XNA. The one style I looked at was using a text file to pull characters like "X" would be a monster and "O" would be the player. Is there another way with out an external file that I can put tiles from a sprite sheet to randomly create a map. Of course when dealing with random buildings I would have certain building designs so that if some one was playing they wouldn't see a building with half a wall missing.

This is for a top down 2D game.

\$\endgroup\$

2 Answers 2

3
\$\begingroup\$

There are a lot of different ways to store this information. I would suggest using something standard, though. For instance a lot of opensource games use the TMX map format as used by the Tiled editor and several others.

TMX uses XML but can store its data in compressed form, as an array, or using a CSV layout. The storage method is for you to choose in the editor.

\$\endgroup\$
1
\$\begingroup\$

To add to the above answer Nick Gravelyn makes a very nice library for importing and rendering TMX maps. Takes about 10 lines of code to import it from Tiled and render it.

https://bitbucket.org/nickgravelyn/tiledlib

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .