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.

Dark GDK / Sprite Collision question.

Author
Message
OceanJeff
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: Ocean Shores, WA
Posted: 8th Jan 2009 11:44
Ok, so I have my circular planetary sprite in the center of the screen, and I have my rectangular ship buzzing around it, and the collision works fine, but the circular body, of course, has the excess rectangular shape of the image masked out with dbSetColorImageKey(), but the collision registers a hit in what appears to be empty space. I have a solution, but I don't want to implement it, I would compute the ship's distance from the center of the object, and if it comes to close, it's hit! Is this the only way? Is this the best way?

Just curious,

later all,

jeff

Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 8th Jan 2009 15:17
Quote: "I would compute the ship's distance from the center of the object"


I think this is a fine solution, thats whats great about circular objects, it makes collision simple.

Login to post a reply

Server time is: 2024-11-25 11:15:44
Your offset time is: 2024-11-25 11:15:44