Hello friends, watching some tutorials on ropes, none leave me happy, although I take some ideas, I consider automating the process a bit and that the creation of the strings is defined with a single sprite and a variable that defines the length of the string .
The technique he used was to create a "HOOK" with an internal variable for the length and two sprites, "SOGA1" and "SOGA2" and that the creation between them would be authenticated with the variables "CC1" and "CC2". I explain: "SOGA1" will spawn "SOGA2" and will go through the "HOOK" .IID of creation and will change "CC2" from 0 to 1, it means that I already created a sprite "SOGA2", in turn the system will verify in "SOGA2 "the same" CC1 "if it is 0 or 1 and will spawn from" SOGA1 ", so for each" HOOK "to its maximum rope limit. This will be done for each SPRITE "HOOK" that you put in the layout.
Up to here is the automatic creation of the sprites, to this is added a physical behavior and only the parameters of the point of each rope are added, which are two, one up and one down, with that we assure that when creating the "revolute" joint "remain together and interspersed, something like this:" HOOK (0) "+" SOGA1 (0) "+" SOGA2 (0) "+" SOGA1 (5) "+" SOGA2 (5) ".... SOGAn. Why is it passed from 0 to 5 ?, because it reviews all the "HOOKS", and verifies that these do not comply with the condition "max rope", and just creates more rope.
I hope you serve, try to simplify the code to the maximum and do the least tangled.