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

Re: [pygame] data files with python syntax



Another excellent usage.  It's just terrible to generate a
special-case language when you're already using a superior
general-case language.

On 7/18/05, Jasper <jasper@xxxxxxxx> wrote:
> Same here.  I've also taken the step of serializing game-save
> information this way (which does take a bit of translation.  This allows
> you to easily view and edit saved games, and more importantly to convert
> them to tests.
> 
> -Jasper
> 
> Shandy Brown wrote:
> 
> >plus, when hand-editing, they're nicely syntax-highlighted for you, which
> >can help you immediately find little mistakes.
> >
> >I've done my level data files and my animation data files this way.  I
> >guess it's sort of a declarative programming approach.
> >
> >-sjbrown
> >
> >
> >
> >>On 7/18/05, kschnee@xxxxxxxxxx <kschnee@xxxxxxxxxx> wrote:
> >>
> >>
> >>>Why not store the room data more simply in a text format, or XML, or
> >>>Pickle? No need to worry about building a mini-compiler into your program,
> >>>and depending on your format it may be much more space-efficient and
> >>>easier to edit with a custom "room editor" program.
> >>>
> >>>
> >>Using plain Python syntax for data is very convenient and has lots of
> >>good points. And you don't need to implement the parser and compiler
> >>yourself, they come included in Python. Some sort of pickle might be
> >>nice if you need to edit the files in a custom editor, but for
> >>hand-editing, the Python syntax is probably close to the nicest thing
> >>you can get.
> >>
> >>
> >
> >
> >
> 
> 


-- 
Andrew Ulysses Baker
"failrate"