Advertisement

Collision process - Corners

Started by February 23, 2002 04:25 PM
1 comment, last by JJXtra 22 years, 11 months ago
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
- Jeff Johnson"He who questions training, only trains himself at asking questions" - Sphynx
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
Advertisement
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.
- Jeff Johnson"He who questions training, only trains himself at asking questions" - Sphynx

This topic is closed to new replies.

Advertisement