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.

DarkBASIC Professional Discussion / Pixel Perfect Collision

Author
Message
Shady Simpson
22
Years of Service
User Offline
Joined: 15th Mar 2003
Location: United Kingdom
Posted: 18th Jun 2003 18:53
Hi,

I remember that IanM(I think) made a sprite collision code that was pixel perfect but I can't find it.

Does anyone know where I can get it?

Thanx.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Jun 2003 19:00
From me

The first function will always work.

The second function is a lot faster, but doesn't always work correctly - I haven't figured out why
Shady Simpson
22
Years of Service
User Offline
Joined: 15th Mar 2003
Location: United Kingdom
Posted: 18th Jun 2003 19:20
Woohoo!
Thanx alot, it works great, I just hated the crappy collision check of DBPro where it checks even the black bits of the sprites.

Thanx.

P.S. That was the quickest response I've ever had.

Bulleyes
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 18th Jun 2003 22:46
Hehehe... just curious, Ian. What is the trick behind those algorithms?

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Jun 2003 23:49
Shady, if you are using the first function, throw it away and use this one instead - I forgot that I made it slightly faster. Time to reorganise my code library I think!

Bullseye, I have added comments to the code in the code box that should explain what is going on.

You may find it easier to follow if you have a piece of graph paper and draw out the various scenarios.

Login to post a reply

Server time is: 2025-08-09 01:32:10
Your offset time is: 2025-08-09 01:32:10