pygame / examples /

Filename Size Date modified Message
..
data
macosx
0 B
6.0 KB
909 B
9.3 KB
4.6 KB
3.0 KB
5.8 KB
2.7 KB
5.7 KB
3.0 KB
3.6 KB
2.8 KB
2.5 KB
2.8 KB
2.7 KB
1.3 KB
2.4 KB
5.4 KB
29.3 KB
1.8 KB
1.7 KB
6.6 KB
1.4 KB
3.2 KB
2.6 KB
4.3 KB
2.9 KB
6.6 KB
1.3 KB
7.3 KB
2.4 KB
6.7 KB
3.2 KB
These examples should help get you started with pyGame. Here is a
brief rundown of what you get. The source code for these examples
is in the public domain. Feel free to use for your own projects.

uberball.py - This was added for pygame-1.5. It is a more complete
    game, similar to breakout. Derived from the pygame chimp example
    it shows how to do menu screens and a more complete game.

aliens.py - This started off as a port of the SDL demonstration,
    Aliens. Now it has evolved into something sort of resembling
    fun. This demonstrates a lot of different uses of sprites and
    optimized blitting. Also transparancy, colorkeys, fonts, sound,
    music, joystick, and more. (PS, my high score is 117! goodluck)

oldalien.py - This more closely resembles a port of the SDL Aliens
    demo. The code is a lot simpler, so it makes a better starting
    point for people looking at code for the first times. These
    blitting routines are not as optimized as they should/could be,
    but the code is easier to follow, and it plays quick enough.

stars.py - A simple starfield example. You can change the center of
    perspective by leftclicking the mouse on the screen.

fonty.py - Super quick, super simple application demonstrating
    the different ways to render fonts with the font module

vgrade.py - Demonstrates creating a vertical gradient with
    Numeric python. The app will create a new gradient every half
    second and report the time needed to create and display the
    image. If you're not prepared to start working with the
    Numeric arrays, don't worry about the source for this one :]

arraydemo.py - Another example filled with various surfarray
    effects. It requires the surfarray and image modules to
    be installed. This little demo can also make a good starting
    point for any of your own tests with surfarray

sound.py - Extremely basic testing of the mixer module. Load a
	sound and play it. All from the command shell, no graphics.

liquid.py - This example was created in a quick comparison with the
	BlitzBasic gaming language. Nonetheless, it demonstrates a quick
	8-bit setup (with colormap).

glcube.py - Using PyOpenGL and Pygame, this creates a spinning 3D
	multicolored cube.

scrap_clipboard.py - A simple demonstration example for the clipboard support.

data/ - directory with the resources for the examples



We're always on the lookout for more examples and/or example
requests. Code like this is probably the best way to start
getting involved with python gaming.


Pete Shinners
shredwheat@mediaone.net


pySDL    : http://pysdl.sourceforge.net
SDL      : http://www.libsdl.org
aliens.c : http://www.libsdl.org/projects/aliens
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.