How do you create and read in .xml files for your program?
Quote:Original post by stanVman
Could I use tinyXML to save and open HighScore struct's for my game?
Yes, if you wanted to. XML is just a format for data to be held in. Technically, you can store anything in XML, I've seen maps, models, html data, etc... used before. Now that's not going to say it's the *best* method, but it's do-able.
If you want to use XML with a high score table, you'd want to first design the format it will be taking on, such as:
<root> <Entry> <Name>Unknown</Name> <Score>1000</Score> <Rank>1</Rank> </Entry> <Entry> <Name>Unknown 2</Name> <Score>1000</Score> <Rank>2</Rank> </Entry></root>
Then it's just a matter of using TinyXML to properly parse that data and extract it. Not much to it really, keep in mind that there are alternatives that might be quicker and more suited for highscores though.
Why optimise the High Score code for Speed?
P.S. You could also use an embedded SQL which might be better.
P.S. You could also use an embedded SQL which might be better.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement