Ropes & Limbs


Got rope?

While working on ARW some of the older functionality has become none working due to all the changes and the usage of Tiled as an editor. One of the things that no longer worked was the rope class, a class to create a sequence of bodies, connected with joints and a texture that aligns and updates according to the body positions.


oldrope.png newrope.png

The old rope & the new rope.


With the old version you had to write what objects to attach the rope to, the exact anchor positions and various properties. With the new version you create it in tiled and attach it, then some basic settings can be set if the defaults are not to the liking.


oldropecode.png

Writing the old rope.


newropeeditor.png

Drawing the new rope.


Beyond how you create them, there has been a few additional improvements. The most useful is being able to create ropes in any direction, the old version assumed a rope would always be hanging vertically. If you made a horizontal rope it would work, but on creation it went crazy for a while until settling.


newrope2.png

You see, it's all in the balance.


Lots of 'em

To test the performance I created a bunch of ropes and attached them to different objects. A rope can be attached to any other gameobject that has a rigid body. By default the rope attaches to the center of that body. By using an extra joint, it is possible to specify the exact anchor location, as well as what type of joint to create. In the below screenshot, the left arm has a rope attached directly and the right arm has a rope attached using a joint to specify the location on the tip of the "hand".


lots.png

Why have a single rope when you can have many?

Performance wise, all good so far. On both computers and mobile devices there are no issues. I use a low-end iPad from 2017 as the target device that should be able to run the final game at 60 FPS.

Let's end with a short video of creating ropes in Tiled and testing them in game. 


Leave a comment

Log in with itch.io to leave a comment.