What is the most used/useful order of operation for collision handling? Currently, I handle the collision as soon as it is found, while doing the standard O(n2) collision detection routine:
#pseudocode for obj1 in obj_lst: for obj2 in obj_lst: if obj1.collide(obj2): collision_handle(obj1, obj2)
Handling collision as soon as detected has been pretty good, but the objects near the beginning of the list always get handled first, and this can affect the objects near the end of the list. How do 2d rpgs do it in practice? I vaguely remember reading something about adding the colliding pairs to a collision list, and use something called a "contact solver" to iterate through the list several times to handle them all. Why several times? Can someone elaborate on this?