So i've successfully created one game in the past and now i'm in the process of writing a breakout clone and one thing i want to do is actually have levels that are loaded from disk. One thing i keep going back and forth on is how to store to the disk, or rather what file type. Right now i'm considering XML and finding a XML parser(i don't even know how to use 3rd party libraries other than like DX XD). I considered XML because i know its quite flexible, then it dawned on me i have no idea how to layout a good XML file. Right now all thats going to be stored is the name of the level, and the blocks, with each block having an x,y, width, height, and texture file name. Problem is i'm not sure how to store that in a way that makes sense. Right now i have it like this
<level> <name>Level 1</name> <blocks> <block> <x>0</x> <y>0</x> <width>20</width> <height>10</height> <texture>block.png</texture> </block> </blocks> </level>
each level will have its own XML file that gets loaded at the start of a level of course. But the problem i ran into is having more than one block of course. should i instead be doing like block1, block2, etc instead of just block? Thats whats confusing me. I'm sure as i go there might be more stuff stored, but for now thats all i have. I would really appreciate some responses and hope this is the right sub section.