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
Oct 23, 2016

Oct 22, 2016

Oct 17, 2016

Oct 11, 2016

Oct 10, 2016

Oct 3, 2016

Oct 1, 2016

Sep 19, 2016

Sep 17, 2016

Aug 30, 2016

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