Jump to content
  • Advertisement

Archived

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

cybrgeek

Collision prevention

This topic is 5964 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''m working on a 2D game, and I need to make it so two objects will continue on their path, but move enough that they will not collide if a collision is possible. For example, I have to objects, called A and B, they are both moving toward point C, or possibly towards different points. I''m able to find if a collision is possible if both objects continue with the same velocity along the x and y axis by finding at what point their paths intersect, and the calculating the time for each object to make it to that point. The problem is I need object A and B to avoid each other when this possible collision is detected, but both continue to move toward point C. I''m not asking for anybody to do this for me, but I need some place to start. Any ideas on a solution, or a place to start would be appreciated. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Thanks a lot, I think that combining that solution with having the object move just over or under/left or right the other object will work, that way if they are moving straight for each other they won''t colide either.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!