Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Pixel Perfect Collisions (download)

Years of Service
User Offline
Joined: 30th Mar 2010
Location: Michigan
Posted: 7th Apr 2010 03:11
UPDATE: 4/6/10 4:35PM
-Added Demo (source code and files for examples...compile and run)
-ADDED FUNCTION fixCollisions() BETA //This will run slower if multiple collisions or detections take place...keyword, BETA
->Allows user to have an auto fix for any collision. See documentation.

-Currently working on fix for sprites with no/some outline
-Testing code to help with multiple collisions or detection of sprite masks (best way to achieve this right now is to minimize your key color in picture)

-When testing out the demo, please feel free to try out multiple sprites! I want you to see that it works with all shapes and sizes!

When using multiple animations for a sprite(such as loading multiple bitmaps for 1 character), be sure and take a good look at the demo. I've created a for loop that detects collisions w/ the character and all objects in level. Before this, I set what direction he was going as a boolean value. This way, when you use dbHideSprite(), the collision is not gonna be tested for each individual sprite (visible or not). This will speed up the collisions by 4x.

DOWNLOAD -------------------------------->


Login to view attachments
Dark Dragon
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 7th Apr 2010 22:27 Edited at: 28th May 2010 04:36

Login to post a reply

Server time is: 2023-10-04 01:08:51
Your offset time is: 2023-10-04 01:08:51