So that the object would not
When collision detection is done and the object's next position would be partly inside a wall, the position would be set as 2*penetration away from the wall. However, what is the best way to do collision detection if there is a possibility that the new position would be inside another object, and reflecting off that would put its position again in the wall, so that the object would not stop moving between the wall and the other object?
This is the sort of thing that physics engines handle for you, contact with multiple surfaces. Otherwise you have to iteratively/recursively handle the collision response.
Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.

