Thursday, April 28, 2011
My 3 Favorite Pygame Tutorials
I read a lot of Pygame tutorials when I first started making small games and wanted to move up from text-only programs. I think the only reason I managed to figure out object-orientation after a ton of time reading tutorials focused on that subject was by writing a game that made use of the Pygame sprite object system and seeing how objects worked in my own real-life example. If it hadn't been for Python and Pygame and how simple and easy they are I don't think I ever would have progressed beyond editing *nix shell scripts. Having played with the Pygame Subset for Android got me to think about those days, and the tutorials and books I learned the most from. Here are some of the resources that I found most useful for learning Pygame:
1 - Invent Your Own Computer Games With Python by Al Sweigart: This is a crucial one. I'd been messing with small sys-admin type scripts in bash for a while and had made a few small "Guess the Number" type games in Python as well before I found this book. Having a free version of the book to read online made it impossible to not try out, and it ended up being exactly what I needed to get past my mental blocks and do more complicated text-based games in Python.
The early chapters start you off at the very beginning of learning programming, making it great for people who are totally new or need a refresher, or people like me who just needed to see things from yet another perspective to really grok them. The later chapters on Pygame were my first introduction to graphical programming without fooling around with object-orientation, and I remain grateful still that neither Python nor Pygame force you to use OOP right off the bat, but let you move up to it once you're ready.
I can't stress how great this book was for me, I'm not sure I ever would have gotten past shell scripts without it.
2 - Python Game Programming Tutorials by Rene Dudfield: A fairly quick intro to Python and Pygame, I liked this for its brevity. It was great whenever I needed a quick refresher on how something simple worked after having taken a too long break from programming.
3 - Piman's Sprite Tutorial: After getting through the Invent With Python book I read a ton of tutorials online as I tried to do more and more complicated things with Pygame. Figuring out the sprite system and understanding object orientation for the first time took me longer than I will ever admit to (ok, it took me almost 3 weeks!!!) but tutorials like this and the official Pygame sprite documentation eventually managed to work through my thick skull. Piman's tutorial is a little out of date, but combined with the official docs it helped me immensely.
Those 3 resources were the ones I kept going back to when I was learning Pygame, and now that my brain is all AS3-focused I know I'll need to hit them up again at some point if I decide to do more than prototype in Pygame.