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

Re: [pygame] "Nutshell" Simple Game Framework



On 4/8/07, Kris Schnee <kschnee@xxxxxxxxxx> wrote:
Greg Ewing wrote:
>  > I'm willing to open-source this if anyone's interested
>
> I'm certain there will be interest -- you can't have too
> many open-source easy-to-use game libraries!-)

It's kind of depressing seeing all the other libraries out there, some
of them with awesome-looking 3D graphics! Still, I'll see what I can do.

> It would be better to separate the RPG stuff into a
> separate class or classes that can be used as mixins
> or by aggregation ("has-a" rather than "is-a") by
> the game author. Also put those classes in a separate
> module, so if the RPG stats aren't being used, that
> whole module can be left out of the game distribution.

Will do.

>  > import Nutshell
>  > w = Nutshell.BasicWorldsim()
>  > w.MakeEntity(nature="Object",name="Pretzel",velocity=[1.0,0.0,0.0])
>  > w.SimulationStep()
>
> A minor point -- if you're intending to release this,
> you ought to consider following the PEP 8 guidelines
> for naming.

Thanks for the reference (<http://www.python.org/dev/peps/pep-0008/>,
for whoever wanted the direct link). That was educational reading. I can
endorse most of that, but I plan to rebel against one rule, because:
        chainsaw.PullCord("RRRRAR!")
looks much nicer to me than:
        chainsaw.pull_cord("RRRRAR!")
especially since I use lowercase_with_underscores for variable names.


A more common compromise would be pullCord if you really can't be bothered to do it the "obvious" way. I've never seen StudlyCaps method names in Python; people will think you're very strange :)

-bob