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
Feb 21, 2017

Jan 31, 2017

Jan 24, 2017

Jan 18, 2017

Jan 7, 2017

Dec 30, 2016

Dec 8, 2016

Nov 28, 2016

Nov 27, 2016

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