[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Re: Implementing save feature



My game pen (http://sf.net/projects/pen) uses XML to save levels and solutions. It's possibly a little fancier than you need because the game itself is extensible, so it uses some python dynamic dispatching. Anyway, you can take a look at the save and load methods of level.py at http://pen.svn.sourceforge.net/viewvc/pen/src/level.py?view=markup

--Mike

Nevon wrote:
Alright, thank you for your replies. I will definitely look into that.

If anyone else has any examples that they could show me, that would be
much appreciated!

On May 23, 12:22 am, James Paige <B...@xxxxxxxxxxxxxxxxxxx> wrote:
Unfortunately, no, I don't have any good examples for you, because most
of my xml experience has not been python based. You might want to look
at the xml modules available in the python standard library
documentation. You can choose from expat, minidom, pulldom, sax,
elementtree, or maybe some I am forgetting. Maybe somebody else on the
list can suggest which is the best match for pygame.

In general though, you will probably end up with a file that has a
node for general data, with some named data elements inside it, and a
node for inventory with a list of item elements inside it, and a node
for flags with a list of flag elements inside it.

---
James