The Invent with Python Blog

Writings from the author of Automate the Boring Stuff.

The Top 10 Pygame Tutorials

Wed 01 September 2010    Al Sweigart

I've scoured the web for some decent tutorials for Pygame, one of the best game engines for Python out there. Here's what I've found, ordered by (in my opinion) quality. Perhaps the most comprehensive guide to Pygame would be the Pygame documentation itself, or Beginning Game Development with Python and Pygame: From Novice to Professional by Will McGuan.

The Python Game Book

A great online wiki that covers many aspects of Python and Pygame.

Program Arcade Games With Python And Pygame

A book similar to my own. I recommend it.

1. Eli Bendersky's website: Writing a game in Python with Pygame

Possibly the best Pygame tutorial on the web. The game example he covers is original and touches on many different concepts. The writing is concise and to the point.

Part I
Part II
Part III
Part IV

2. Invent Your Own Computer Games with Python by Al Sweigart

This is my own tutorial for Pygame. The first three chapters cover the basics of Pygame's features, and the fourth chapter details the entire source code to a simple "Dodger" game.

Chapter 17 - Graphics and Animation
Chapter 18 - Collision Detection and Input
Chapter 19 - Sound and Images
Chapter 20 - The "Dodger" Game

UPDATE: I also have the rough draft completed copy for my Pygame-specific book available: Making Games with Python & Pygame

3. Lorenzo E. Danielsson's blog: Keeping it Small and Simple: Pygame Tutorial

A nice and lengthy tutorial covering a Worms game clone. This tutorial has nine parts, and goes into a good amount of detail on graphics and mouse input.

Pygame tutorial #1: getting started
Pygame tutorial #2: drawing lines
Pygame tutorial #3: mouse events
Pygame tutorial #4: more on events
Pygame tutorial #5: pixels
Pygame tutorial #6: from pixel to worm
Pygame tutorial #7: more on lines
Pygame tutorial #8: the worm game
Pygame tutorial #9: first improvements to the game

4. Pygame Physics Simulation

A multi-part tutorial that covers Pygame, basic physics simulation, and several other related topics in an easy-to-read format. Give this tutorial a read as it offers good info on things that none of the other tutorials cover.

5. LearningPython.com

A fairly good three-part tutorial covering an actual game. I'd recommend giving this one a read-through at least.

Introduction
Part 1
Part 2 - Creating a Level
part 3 - Adding the Bad Guys

6. Rene Dudfield's Python Game Programming Tutorial

Fairly decent introduction to Pygame, with a quick intro to Python itself. This tutorial covers installing Python and Pygame, and an example program of a "Punch the Monkey"-style game. The sixth lecture is unfinished.

Lecture 1
Lecture 2
Lecture 3
Lecture 4
Lecture 5
Lecture 6

7. sjbrown's Guide to Writing Games

A very formal tutorial that covers Model-View-Controller architecture, but this tutorial also covers games with networking capabilities with the Twisted framework. This may be a bit advanced if you are new to Python or programming in general, but is worth a read through.

8. Rapid Game Development with Python - by Richard Jones

A rather brief look at Pygame, but it does cover the basics nicely.

9. Penzilla.net's Python Tutorial

Short, and covers just a simple Hello World example. But he also has a couple other tutorials with Pygame implementations of Conway's Game of Life and a heat simulation.

Conway's Game of Life in Pygame
Heat Simulation in Pygame

10. ShowMeDo - Using Pygame for Games

The audio has somewhat bad quality to it, and the guy's voice can be hard to follow along with sometimes. But he does offer a fairly nice tutorial that covers some of the basics. If you'd prefer a video tutorial, this would be one to watch.

Video 1 - Installation
Video 2 - Blitting and moving an image
Video 3 - Gameplay

UPDATE: This is an old post, written before I finished my book entirely dedicated to Pygame. You can read a free online copy of "Making Games with Python & Pygame" at http://inventwithpython.com/pygame.

UPDATE: I've add Dr. Craven's excellent book and Horst JENS wiki.


Learn to program for free with my books for beginners:

Sign up for my "Automate the Boring Stuff with Python" online course with this discount link.

Email | Mastodon | Twitter | Twitch | YouTube | GitHub | Blog | Patreon | LinkedIn | Personal Site