The Invent with Python Blog

Writings from the author of Automate the Boring Stuff.

New Game Source Code: Squirrel Eat Squirrel

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. This is a Python 3 game, but I think it's compatible with Python 2. You need Pygame installed as well.

Use the arrow keys to move around. You can be hit three times before you die.

Download the source & images.

Try modifying the constant variables at the top of the file to change around the game. (Squirrel speeds, number of squirrels, amount of health, etc.) This isn't part of my Code Comments tutorials, since I haven't had time to go through and add detailed comments to the code (but it's still commented.)


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