Archived

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

Collision process - Corners

This topic is 5805 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have collision detection and reaction working fine, except when a hit occurs with an object that is either against the side of the screen, or in the corner of the screen. This is for a 2D space combat game im making. When the collision happens in these instances, the objects remain stuck to each other. Does anyone know how to remedy this so that the objects don''t remain stuck? Thanks- Jeff

Share this post


Link to post
Share on other sites
This is probably occuring because each side of the corner causes the object to bounce toward the other. You''ll need to fudge the solution somewhat. Add a tiny perturbation to the bounce angle for one side of the corner so that the object does not become ''wedged''.

Cheers,

Timkin

Share this post


Link to post
Share on other sites
I got around it by putting in the collision algorithm to make sure there was no collision when it was done. If there still was a collision after the algorithm, it runs again, moving the objects further until there is no collision. Do you think that is efficient enough? I only plan on having the game 4 player with maybe several other comp. ships.

Share this post


Link to post
Share on other sites