I’m trying to create a game save system which involves saving a score for each level when each level is complete and was thinking of using xml. I’m quite confused about how to do this. I’ve seen serialization like the particle system example on MSDN, but each particle system is split into seperate files. I want something like this:
parent
level
id 1 /id
score 0 /score
/level
level
id 2 /id
score 0 /score
/level
etc. And then all the data is loaded from one xml. What then confuses me as well is how I would serialize and unserialize it. Help would be greatly appreciated.
You need to setup a single class that contains all the data, such as:
Then you can serialize and deserialize it using the
XmlSerializerclass. I’m sure you can find many many examples of that if you searched the web.