\$\begingroup\$

After calculating the rope, save the points it bends at relative to the objects, that cause that bend and the rotational direction (whether the rope bent in the right or the left direction). You can use these relative positions to reposition the rope during gameplay, but there will be 3 different interactions you need to pay attention to:

1.) An object hit the rope, so it should bend around it: This can be solved very easily using the same techniques you used during setup.

2.) An object stopped colliding with the rope: This very easy to solve, but a bit tricky to detect. This is why you need to save the bending direction at the beginning. If the rope bent around an object to the left, but it now bends to the right, that means that it got deattached from the object and you should merge the two segments

3.) The rope got shorter: Since the rope has to adapt to the moving objects, more of it has to be used to bend around parts. To solve this, take the last segment and shorten it. If it's not long enough, remove that segment and shorten the second to last and so on.