Archived

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

cybrgeek

Collision prevention

Recommended Posts

cybrgeek    122
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
cybrgeek    122
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