Skip to content

Latest commit

 

History

History
47 lines (24 loc) · 1.7 KB

README.md

File metadata and controls

47 lines (24 loc) · 1.7 KB

Python Games

You'll find Python Games on the Desktop or in the application menu:

Python Games in the application menu

Double click this icon to start. This will prompt you to set your audio configuration to output sound over HDMI or the headphone jack. Make a selection or leave it as it is and click OK to proceed.

Audio configuration

Now you'll be shown a tall window with the list of games available:

Python Games selection screen

Pick a game, click it and hit OK to play.

Examples

Four in a Row

Four in a Row

Flippy

Flippy

Game source code

The source of each of these games is available on the Pi. Simply navigate to the directory /home/pi/python_games in a terminal or the file manager and you'll see the assets and source code.

The python_games directory listing in a terminal window:

Python Games in a terminal

The python_games folder contents in a the file manager window:

Python Games in File Manager

The Python source code for the Four in a Row game, open for editing in IDLE.

Four in a Row source code

Hack the game

You can edit the source of these games. Why not make a copy of a Python file, look through the code and change some numbers? See what happens.

If you can figure out how the game works, try to hack it to make it better, make it harder (or easier) to win, or add some features to the game! You could add GPIO interaction so lights flash when you win, or add input buttons.