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 / better sprite collision detection?

Author
Message
HellsDevilDog
15
Years of Service
User Offline
Joined: 18th Mar 2011
Location: Ohio
Posted: 27th May 2011 18:56 Edited at: 27th May 2011 18:56
not sure what to set the subject at, but I was wondering if there's an easy way to set the collision for a sprite to the pixels that are not transparent.

Take this image for an example:
http://imageshack.us/photo/my-images/41/imageqbo.jpg/

I want the "sprite collision(1, 2) = 1" to return the value 1 only if the orange pixels are hit by anything, and not the transparent background. Is their any easy way to do this?

(I'm using .png's right now, Haven't gotten into keying a special color out yet)
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 27th May 2011 19:01
You could try looking up "pixel perfect" sprite collision but unless it's really necessary it'll slow your game down I believe. Depends what you use it for I guess...

Login to post a reply

Server time is: 2026-07-11 04:23:13
Your offset time is: 2026-07-11 04:23:13