Pygame Zero programs
Distributing your Pygame Zero games
You can distribute your games to people who don’t have Python or Mu installed. You can put them on a USB stick, or a website for people to download, or even on itch.io for people to buy.
Install the full version of python from here
Edit your game source code (using Mu). We will assume your source is in a file
NAME_OF_GAME.py. At the top of the file add the line:
At the bottom of the file add the line:
Open a command prompt (Click start menu and type
Enter your mu_code folder. At the prompt type:
Install pyinstaller and pgzero. At the command prompt type:
pip install pgzero pyinstaller
Copy the pgzero folder into your mu_code folder. You should find the pgzero folder at:
You should find your mu_code folder at:
Create the executable. At the command prompt type:
pyinstaller NAME_OF_GAME.py --distpath . --add-path "pgzero;pgzero" --onefile --noconfirm --nowindow
This will generate a program called
NAME_OF_GAME.exe. You can double click this program to play your game.
To distribute your game you need to copy the entire mu_code folder. You could put it inside a zip file, and then put that on a website.