Archived

This topic is now archived and is closed to further replies.

lexor

Collision between rect and vertexarray

Recommended Posts

Hi everyone! Im trying to do a colisiondetection for my 2d-game, but I cant seem to figure out how to do the math Guess I should have paid more attention in my math-classes. I have an array of vertexpoints mapped out to fit the borders of the landscape. The main character only needs a RECT type of boundingbbox. How do I calculate if a collision appears? (that is when the character tries to walk on the (invisible) lines between the vertexpoints) The main character is trapped in the irregular shape made up by vertexpoints so there is a limitation in all directions. I''ve done alot of thinkin about this and this is the only method that could do the job with a good speed. Thanks in advance!

Share this post


Link to post
Share on other sites