File: README.rst

package info (click to toggle)
pgzero 1.2.post4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,980 kB
  • sloc: python: 4,273; makefile: 165
file content (69 lines) | stat: -rw-r--r-- 1,686 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Pygame Zero
===========

A zero-boilerplate games programming framework for Python 3, 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('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
------------

See `installation instructions`__.

.. __: http://pygame-zero.readthedocs.org/en/latest/installation.html


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.

Contributing
------------

The project is hosted on Github:

https://github.com/lordmauve/pgzero

If you want to help out with the development of Pygame Zero, you can find some
instructions on setting up a development version in the docs:

http://pygame-zero.readthedocs.org/en/latest/contributing.html