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.clear()
    screen.blit(images.dog, (10, 50))

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

def on_mouse_down():
    sounds.eep.play()

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

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

def draw():
    screen.clear()
    alien.draw()

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

Installation

  1. Install Pygame for Python 3 * https://bitbucket.org/pygame/pygame/downloads - Windows * https://launchpad.net/~thopiekar/+archive/ubuntu/pygame - Ubuntu

  2. Install Pygame Zero (python setup.py install)

  3. “python3 -m pgzero <pgzero program>” or (if installed correctly) pgzrun <program>

Documentation

The full documentation is at http://pygame-zero.readthedocs.org/.

Read the tutorial at http://pygame-zero.readthedocs.org/en/latest/introduction.html 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.

Source Distribution

pgzero-1.0.1.tar.gz (323.9 kB view details)

Uploaded Source

File details

Details for the file pgzero-1.0.1.tar.gz.

File metadata

  • Download URL: pgzero-1.0.1.tar.gz
  • Upload date:
  • Size: 323.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pgzero-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e5c9960ab810ebf99f7f7a8085c491b3e9301280c2dd65935bc00c2fa93d7088
MD5 4ad92268334f5d3250f5cb29c8811b63
BLAKE2b-256 dc6066268e59bd0379656fbba4b6b5e541cf28bec00527dc5047ad9b0b75721a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page