The Python Game Book

code games. learn Python.

User Tools

Site Tools




pygame zero

A zero-boilerplate games programming framework for Python 3, based on Pygame.

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.

See github link for some (beautiful) examples. To run the examples, type pgzrun <>

It is also possible to modify pygamezero programs to run directly from python:

import pgzrun

# ---- start of pgzero code ---
# (replace with other example)
WIDTH = 800
HEIGHT = 600

def draw():
    screen.clear(), 300), 30, 'white')

# -----end of pgzero code ----
# instead of typing 'pgzrun <filename>' use this python line:

en/glossary/p/pygamezero.txt · Last modified: 2020/07/17 11:16 by horst