Collision prevention

Started by
1 comment, last by cybrgeek 22 years, 1 month ago
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.
Advertisement
slow one of the objects down, or speed one up. that should work (unless they are headed directly towards each other).

--- krez (krezisback@aol.com)
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
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.

This topic is closed to new replies.

Advertisement