The Python Game Book

code games. learn Python.

User Tools

Site Tools


Sidebar

Github:

en:glossary:p:pygamezero

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 <name-of-example.py>

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()
    screen.draw.circle((400, 300), 30, 'white')

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

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