A collection (18) of free python games.
In the first half of 2012, I wrote ten games to teach a group of students some basics of programming. The goal was to have fun as much as it was to learn. Here you'll find simplified versions of several classics.
In 2013, I used these games again as part of a programming club for high school students at Downtown College Prep in San Jose, CA. At that time, I added a number of new games bringing the total up to eighteen and covering more advanced topics like projectile motion and encryption.
In 2014, I used these games as part of week-long programming club that met in the evenings at The River Church Community in San Jose, CA. Our demographic was middle and high school students.
Each game is entirely independent from the others and includes comments along with a list of exercises to work through with students. Creativity and flexibility is important. There's no right or wrong way to implement a new feature! You never know which games the students will find really interesting.
Nibbles -- like Snake on the old Nokia phones.
Memory -- match tile pairs of numbers to uncover the hidden image.
Tiles -- shuffle image tiles to solve the puzzle.
Pacman -- simplified version of the classic.
Maze -- solve a randomly generated maze.
Tic Tac Toe -- the classic.
These games were tested on a Win32 system running Python 2.7 with pygame installed.
Most games should work for Linux-type systems. Where needed (e.g. hangman.py), I tried to make the code cross-platform compatible.
For Python 3 compatibility, you'll need to run the 2to3 tool, change division (/) to integer division (//), and convert return values of filter(..), map(..), etc. calls to lists.
MIT-licensed.
Copyright (c) 2014 Grant Jenks Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
What follows are notes for a week-long curriculum with about 3 hours of classroom time each day.
- Interactive python interpreter
- nibbles.py - Commenting code
- guess.py
- paint.py - Getting help in the ipython interpreter
- tron.py
- crypto.py
- memory.py
- pacman.py
- bagels.py
- cannon.py
- cups.py
- tictactoe.py
- hangman.py
- sonar.py
- simonsays.py
- pong.py
- connect.py
- maze.py
- tiles.py
- guess.py | text-based, puzzle
- hangman.py | text-based, two-player, puzzle
- crypto.py | text-based, topic:encryption
- bagels.py | text-based, puzzle
- connect.py | two-player, game
- tron.py | two-player, game
- pong.py | two-player, game
- maze.py | game, topic:maze
- cannon.py | game, topic:projectile-motion
- cups.py | game, topic:animation
- sonar.py | game, topic:distance
- nibbles.py | game
- pacman.py | game
- tictactoe.py | game, topic:artificial-intelligence
- memory.py | puzzle, image
- simonsays.py | game, puzzle
- tiles.py | puzzle, image
- paint.py | topic:drawing
- flappy.py | nyi