Jump to content
  • Advertisement

Archived

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

JJXtra

Collision process - Corners

This topic is 6137 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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!