Skip to main content

A zero-boilerplate 2D games framework

Project description

A zero-boilerplate games programming framework based on Pygame.

Some examples

Pygame Zero consists of a runner pgzrun that will run a Pygame Zero script with a full game loop and a range of useful builtins.

Here’s some of the neat stuff you can do. Note that each of these is a self-contained script. There’s no need for any imports or anything else in the file.

Draw graphics (assuming there’s a file like images/dog.png or images/dog.jpg):

def draw():
    screen.blit(, (10, 50))

Play the sound sounds/eep.wav when you click the mouse:

def on_mouse_down():

Draw an “actor” object (with the sprite images/alien.png) that moves across the screen:

alien = Actor('alien')
alien.pos = 10, 10

def draw():

def update():
    alien.x += 1
    if alien.left > WIDTH:
        alien.right = 0


  1. Install Pygame for Python 3 * - Windows * - Ubuntu
  2. Install Pygame Zero (python install)
  3. “python3 -m pgzero <pgzero program>” or (if installed correctly) pgzrun <program>


The full documentation is at

Read the tutorial at for a taste of the other things that Pygame Zero can do.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pgzero-1.0.tar.gz (320.1 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page