Home | About Me | Photos | Writing | Research | Scratchpad | Projects

Pong!

When learning Python, I decided to have a bash at writing a game using Pygame - a Python wrapper for SDL, for the geeks :) The result was a fairly simple Pong game. Reading the source would be a good way to introduce yourself to making a full game in Pygame (after reading the chimp tutorial provided on the Pygame web site). TomPong is also (at time of writing) being used as part of a computer science course in object orientated programming at Princeton University in the USA, as a point of reference for a Java Pong game :)

For those interested in making their own games, I have written a tutorial in making games with Pygame that accompanies TomPong. It describes how to go from making things appear on the screen, to implementing a simple game of Pong. You can find it here.

Currently implemented features are:

As you can see, it's very advanced :) I've just completed a simple spin model (view source to see it - it's the checkspin() function in the Ball class).

TomPong was inspired by, and in part based on, Pypong, which can be found at: http://www.mrexcessive.net/games/gigglebubble/ The images for the bat was taken from LBreakout2 by Michael Speck, which is found at: http://www.lgames.org.

Controls:
    space bar - release ball to start playing
    a & z - up and down, player 1
    up_arrow & down_arrow - up and down, player 2
    p - pause
    f - toggle fullscreen

Command-line options:
    -f - start in fullscreen mode
    -d - start in debug mode (good to find bugs/watch how it works)
    -s=x - make ball speed equal to x
    -ai=x - have computer control second player, with skill equal to x (0-10, where 10 is best)


A screenshot:
TomPong


Download:
tompong-0.5.1.tar.gz (23.4kb)
tompong-0.5.tar.gz (23.1kb)
tompong-0.4.tar.gz (22.7kb - added GPL LICENSE file)
tompong-0.3.tar.gz (14kb!)
tompong-0.2.tar.gz (10kb!)


Installation:
Dependencies:


Changelog: