How to Install Pygame on Windows, macOS, and Linux
Fri 27 January 2023 Al Sweigart
Writings from the author of Automate the Boring Stuff.
Fri 27 January 2023 Al Sweigart
Tue 19 February 2013 Al Sweigart
Mon 10 December 2012 Al Sweigart
I've created Python & Pygame script that lets you walk around the overworld map of the original Legend of Zelda game on the 8-bit Nintendo. There are no monsters or levels or items; it is simply a walking tour. The Link walking sprite animation is implemented by my Pyganim module.
Tue 30 October 2012 Al Sweigart
A button is a common user interface (UI) control that is used in many software applications. It seems simple enough: there's a button on the window and you click on it and something happens. But there's a lot of details we should plan out ahead of time. Remember, we want to make a generic button class so that other programmers can use this in their games and programs. Once you've read through the process here, you'll be familiar with how to make your own modules for UI elements.
Wed 18 July 2012 Al Sweigart
Fri 21 October 2011 Al Sweigart
Here are a couple games I wrote. The first was so popular that I made a sequel.
Fri 07 October 2011 Al Sweigart
If you already know a bit of programming and Python, and want to get up to speed on the Pygame 2D game framework, here's a cheat sheet that you can look over. It implements a very short Pygame program covering most of Pygame's basic features.
Sun 18 September 2011 Al Sweigart
The Caesar Cipher Wheel is a paper cutout that can be used to perform encryption and decryption in the Caesar Cipher. However, if you don't have a printer but do have Python and Pygame installed, you can use this Caesar Cipher Wheel program to rotate a virtual cipher disk instead.
Sat 17 September 2011 Al Sweigart
Draw out horizontal, vertical, or diagonal lines in the same directions that the dot moves. The pattern of the dot's movement becomes longer and longer.
Sat 10 September 2011 Al Sweigart
Pygcurse (pronounced "pig curse") is a curses library emulator that runs on top of the Pygame framework. It provides an easy way to create text adventures, roguelikes, and console-style applications. The mascot of Pygcurse is a blue pig with a skull tattoo on its butt.
Fri 24 June 2011 Al Sweigart
Here's the source code for a Bejeweled clone called Gemgem, written in Python with Pygame.
Mon 13 June 2011 Al Sweigart
Here's a Sokoban ("box pusher") clone called Star Pusher. I've used the graphics from the Planet Cute collection. You'll need Python (2 or 3) and Pygame installed to run it. Just download and unzip the files to the same directory. It comes with 201 levels from David W. Skinner.
Fri 10 June 2011 Al Sweigart
I've made a Connect Four AI in Python with Pygame.
Mon 16 May 2011 Al Sweigart
I wanted to share this link to a great site with some simple Pygame examples:
There is also a textbook draft called "Introduction to Computer Science Using Python and Pygame" by Paul Vincent Craven.
Sat 30 April 2011 Al Sweigart
I've compiled a list of free graphics and sound files that you can use in your games. The chapter on using graphics and sound files with the Pygame library is in Chapter 19 of the "Invent with Python" book.
Sun 06 March 2011 Al Sweigart
Made a new game with Pygame. It's called "Squirrel Eat Squirrel", where you move your squirrel around the screen eating the smaller squirrels and avoiding the larger ones. The more squirrels you eat, the larger you grow.
Fri 25 February 2011 Al Sweigart
I have a text version of a Connect Four clone done. The AI for it looks ahead two moves, which makes it fairly impossible to beat unless you concentrate.
Mon 03 January 2011 Al Sweigart
Welcome to the Code Comments Tutorial for Flippy, an Othello clone. Code Comments is a series of simple games with detailed comments in the source code, so you can see how the game works.
Thu 18 November 2010 Al Sweigart
Welcome to the Code Comments Tutorial for Tetromino, a Tetris clone. Code Comments is a series of simple games with detailed comments in the source code, so you can see how the game works.
Fri 29 October 2010 Al Sweigart
Welcome to the Code Comments Tutorial for Snakey, a Nibbles clone. Code Comments is a series of simple games with detailed comments in the source code, so you can see how the game works.