Demo gif

Python Prison

A puzzle game where you have to bribe cops and write Python programs to break out of jail!


Despite explaining to the cops "everyone wears a balaclava to the bank" you keep inexplicably finding yourself locked in jails. Luckily there's plenty of materials around to bribe the guards with. If not perhaps you can make more? You may end up having to execute some of the characters the jail holds...

Can you make your way out to the redemptive grass?

To Play

Download and extract the zip and navigate to the folder and run these commands:

pip install -r requirements.txt

Python Prison was Built using Python 3.9.2 and pygame 2.0.1 and tested on the latest Python 3.9.4.

It was tested on Windows 10 and Linux Mint but not Mac OS because I don't have a Mac computer to test it on.

I have received reports it may crash around level 5 on Mac :(


  • WASD/Arrows - move
  • Shift - sprint
  • Space - pull
  • 1 - set the top left of the blue execution region
  • 2 - set the bottom right of the blue execution region
  • 3 - set the top left of the red output region
  • 4 - set the bottom right of the red output region
  • R - run the code contained in the blue execution region
  • Esc - reset level
  • M - toggle mute
  • I - toggle info
  • F9 - main menu
  • F10 skip level (cheating!)
  • F12 skip to sandbox (cheating!)

Video Playthrough

A full playthrough can be watched here - - but be sure to try the game yourself first!

gif demo

Resources Used

I wrote all the code and made all the assets for the game except for the following:


Self-referential Goodness
Presented by mit-mit

crab of approval
Presented by LargAnk

Give this entry an award


Ratings (show detail)

Overall: 4.2
Fun: 3.9
Production: 4
Innovation: 4.8

Respondents: 12


File Uploader Date
Final Game - only updated readme
discretegames 2021/04/04 21:42
Demo gif
discretegames 2021/04/04 21:32
Level 5 - Writing Code
discretegames 2021/04/03 19:20
Finished game with 10 levels
discretegames 2021/04/03 19:12
Level 3 - Bribing cops
discretegames 2021/04/03 06:04

Diary Entries

Had fun in my first ever game jam

This will be my first and last diary entry - maybe I wish I had written more but I was too focused on completing my game: Python Prison.

Everything is now done and tested. My biggest regret is I didn't have enough time to make more levels. Though here's a sneak peek of the last and hardest level "Pythonic Alcatraz":

Pythonic Alcatraz

This was my first ever game jam style event and I had a lot of fun! Though I really wish I had started coding sooner. I feel like I did almost nothing for the first few days and didn't get much sleep the last few days.

I hope people enjoy my game and find it unique. If anyone gets stuck on parts of it there is a full video playthrough.

It will be interesting to play all the other games.

1 comment