Hi all,
I was speaking with the group from Games for Science about how to get bootstrapped in the world of Python game programming and thought that this might be information that others might want to get their hands on.
First, a few important facts:
- Whereas other languages are broken down using brackets, Python is based on indentation/white space.
- Python does not require you to declare data type for variables (the old 'int a = 3' is just 'a=3')
- Python is not named after the snake, but Monty Python's Flying Circus; any Monty Python related comments are not only allowed, they are encouraged (seriously, that's out of the official documentation, read the paragraph 4th from the bottom )
A good place to get started is the official Python documentation (
Python 2.7 Library ) and do a little reading, especially in section 2 since it covers all of Python's built-in functions. Remember: if it's not a part of Python, it can be imported. (which brings us to our next link...)
Python doesn't have the best support for graphics in the world, so we import a library called '
PyGame'. PyGame has a pretty good site, and when I learned Python I actually skipped the official tutorials and went straight to
the PyGame tutorials.
Finally, PEP-8 is a standard for indentation, capitalization, commenting format, etc. Attached is a PEP-8 complacency cheat sheet (because we all know from high school history class that cheat sheets are a force of good). Using PEP-8 will make you the object of adoration of your coworkers and online peers. I promise.
And, on a final note, if you're ever lost read the documentation. This isn't my being sadistic and tricking you into killing hours of your time, reading official documentation will make you more dangerous in any language you ever choose to pick up.
And speaking of cheat sheets, here's a cheat sheet for this email...
Documentation:
My common resources:
Google - Throw 'Python' or 'Pygame' in the name and google like mad.
IRC - On the
Freenode servers you can find help from #Python and #Pygame channels
If you have any questions, feel free to shoot me an email to let me know!