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

Re: [pygame] Pygame.init In Multiple Files



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Three suggestions:

1. Don't use globals. This is a general rule that would apply here to make
   things a little neater. Have worldsim_evergreen's code and data
   encapsulated in a class and instance(s) of that class. Explicitly
   instantiate the object and initialise it when you intend to. Make the
   instance a singleton if need be.

2. Use "if __name__ == '__main__':" blocks to determine whether a script is
   being run stand-alone (true) or whether it's being imported (false).

3. Don't re-bind variable names to things of different types.
   GENERIC_PERSON_IMAGE is either a filename *or* an image. Sounds like an
   image to me. GENERIC_PERSON_FILENAME sounds like a filename.


    Richard
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFB/aCqrGisBEHG6TARAhAPAJ9b9ex1RP4hLbuCQPljzYsTzd+a1wCcCgAR
+WRfIz5jI6XPUUgoHd6l1dQ=
=ZxUh
-----END PGP SIGNATURE-----