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 / SPRITE COLLISION and SPRITE HIT performing the same in DBPro

Author
Message
iac249
23
Years of Service
User Offline
Joined: 26th Mar 2003
Location: USA
Posted: 15th Apr 2003 05:59 Edited at: 15th Apr 2003 06:02
I've noticed that SPRITE HIT is returning true when only the transparent areas of the bitmap have overlapped. I thought this was supposed to be SPRITE COLLISION and that SPRITE HIT detected when non-transparent areas overlap.

Here's a code snip. What's up with it?



Thanks!
iac249
23
Years of Service
User Offline
Joined: 26th Mar 2003
Location: USA
Posted: 15th Apr 2003 06:01 Edited at: 15th Apr 2003 06:03
Oh, and if anyone sees a better way to set up these sprites, please let me know!
CloseToPerfect
23
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 15th Apr 2003 08:01
DBP uses planes for sprites and pixel perfect collision is not and may not ever be implemented. collision only checks for plane overlapping.

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 15th Apr 2003 15:31
If you are not rotating or scaling your sprites, then it would be worth your while to have a quick look in the Code Snippits. There are two methods in there for doing this - one by ChipOne and me, and another by freddix.

Both can be found on this post : http://www.darkbasicpro.com/apollo/view.php?t=5963&b=6
iac249
23
Years of Service
User Offline
Joined: 26th Mar 2003
Location: USA
Posted: 15th Apr 2003 20:17
That'll work, IanM. Thanks!
HZence
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 16th Apr 2003 03:48
I'm having trouble with sprite collision in general...it doesn't detect it for some reason - ever! I just tried to check if the main character of my game was colliding with a transport beacon and it wouldn't work - I even tried removing the transport code and adding a line that said

Center Text 50, 50, "THE SPRITE IS FREAKING COLLIDING"

and even that didn't come up! Me and my back luck, I tell ya what...

Login to post a reply

Server time is: 2026-07-11 12:01:56
Your offset time is: 2026-07-11 12:01:56