pygame is
Simple DirectMedia Layer is
Site Swing

PixelPerfect - 1.0

John Eriksson (wmjoers)



A simple pure python implementation of an pixel perfect collision detection algorithm.

When starting the example 200 sprites is added to the screen at random locations. You can then move a larger blue sprite around by using the arrow keys or by using the mouse. Press spacebar to toggle between the pixelperfect-algorithm and the regular rectangle based one.

Whenever a hit is detect it is indicated by the BOOOM! text.

There is a bug in the current PyGame release that prevents this example from working. But if you check out the latest PyGame version from CVS it should work just fine!


Home Page:


click to view original size


PixelPerfect - 1.0 - Mar 2, 2006 account Comments

If you wish to leave a comment with your account, please sign in first.

January 18, 2009 8:16pm - Salvatore Han - nickname: (eluem) - 5/5
This works really well, I don't see why it hasn't been made part of the pygame library...

our projects welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
recent releases
Nov 17, 2015

Nov 12, 2015

Nov 11, 2015

Nov 8, 2015

Oct 16, 2015

Oct 9, 2015

Sep 11, 2015

Sep 6, 2015

Aug 26, 2015

Aug 25, 2015

... more!
for pygame related questions, comments, and suggestions, please see help (lists, irc)