PixelPerfect v1.0

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

Example Instructions

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.

Screenshot

Related links

  • Python - The python programming language.
  • PyGame - Game development for Python.

Downloads

Known bugs!

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!

There is also a workaround to this bug. You have to do a double unlock() after the using pygame.surfarray.array_colorkey() method on an image.

No License

Both the PixelPerfect implementation and the example code is public domain.


Comment this project:

Your name:
Your email (hidden):
Message:
Enter the validation code :
Private! (visible for webmaster only)

2012-02-17 20:55:14
2011-06-25 03:53:11
Eluem 2009-01-19 01:55:35

It doesn't seem to work for me... it still gives me this error:

NotImplementedError: surfarray module not available

I really wanted to test this out...

Anonymous 2007-08-14 15:52:55

Elliot:

You should download WinImp. It's free and it extracts gzip, .gz, .rar,
and a bunch of other ones. I think I got it here:

http://www.simtel.net/product.download.mirrors.php?id=61817

Click the 'Worldwide Content Distribution' link and it will start downloading
in a few seconds.

Anonymous 2007-08-09 19:40:16

PLEASE RELEASE A ZIP DOWNLOAD!!!!! I can't extract .tgz files and it's driving
me CRAZY!!!! I really need some perfect collision detection for my Asteroids game
and this should work PERFECT!

View all