Skip to content

WokLibCodeClub/Using-Pygame-Zero

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Using Pygame Zero for better Python graphics

Pygame Zero is an extension for Python which makes it easy to code exciting and interesting games. It has far more graphics options than the Python turtle library, and lets you create graphics objects which are quite similar to Scratch sprites in their flexibility.

This unit describes how you can add the Pygame Zero extension to your Python setup, and how you can create and run code which uses Pygame Zero functions.

Note: unfortunately you can't use Pygame Zero with trinket projects. If you want to take advantage of Pygame Zero you will need to have Python installed on your own computer. The section of this website on Installing Python describes how you can do this.

If you want to read all the information about Pygame Zero here is the link to the Pygame Zero website:

https://pygame-zero.readthedocs.io/en/latest/index.html

This site has detailed instructions about installing Pygame Zero, tutorials for building code and some example games to show you the possibilities.

In this section of our github site we concentrate on the basics of getting and running Pygame Zero.

Getting Pygame Zero on your computer

Follow this link for instructions on how to install Pygame Zero on your computer. Note - you need to have Python installed first.

Running code with Pygame Zero on your computer

Follow this link for instructions on how to run your code using all the Pygame Zero functions on your computer. Note - you need to have Python installed first.

What does Pygame Zero do?

Follow this link for an explanation of how Pygame Zero works, and the extra processes that go on in the background when you run Python code with Pygame Zero.

Comparing Pygame Zero and Scratch

If you have written projects using Scratch you may be interested in how a Scratch project and a Pygame Zero project compare.

On the Pygame Zero website look at the section "Migrating from Scratch" where you will find versions of the game Flappy Bird written in Scratch and written using Pygame Zero.

Example games written using Pygame Zero

Follow this link on the Pygame Zero website for descriptions of some fantastic games written using Pygame Zero.

If you want to download the code for these games then go to this link, click on the green button marked Code with a download arrow, and choose Download ZIP. When you open the ZIP file you will see a folder called pgzero-master. Click on this to open the next level. Now click on the folder called examples. In this you will see a project folder for each of the example games. Copy any or all of these to your computer and start playing and experimenting!

About

How to incorporate the Pygame Zero extension into your Python programmes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages