Reputation: 3893
I want to practice programming with (popular) android physics engines (AndEngine and libgdx).
It is not very difficult to create a small world with physics objects but now I want to create a rope and connect it to objects in the world.
There are several ways to do it, for example:
http://www.emanueleferonato.com/2009/10/05/basic-box2d-rope/
But I want to see a smooth rope like in "Cut The Rope" game on Android and IOS.
Are there any ideas how to do this? I can't find answer yet but I think it would be to create a number of smaller objects tied together but I think this would be bad performance-wise?
Upvotes: 4
Views: 4009
Reputation: 121
On ios we based our rope on this example, http://www.cocos2d-iphone.org/archives/1112 , we are now trying to port it to android, but our version of the box2d does not support the rope joint yet.
Upvotes: 0
Reputation: 3748
I believe your instinct to create shorter segments with joints connecting them is correct and yes, the number of bodies you end up creating for a length of rope will have an effect on the performance.
To know whether it will work for your particular situation, I would suggest creating a rope with variable length segments and make a decision based off benchmarking the performance as to how smooth you can make the rope by increasing the number of segments.
Upvotes: 4