Skip to content

Latest commit

 

History

History
32 lines (20 loc) · 1.24 KB

README.md

File metadata and controls

32 lines (20 loc) · 1.24 KB

VRope-x

Cocos2d-x /c++ port of simple rope system for cocos2d using Verlet Integration.

The VRope-x was ported to Cocos2d-x (v2.0) by Creeng Ltd..

The port was made from VRope 0.4 made by Flightless, which was a modified version of the original implementation by patrickC. The Flightless version added a MIT license, which is also contained in this ported version.

Demo video

Usage

Create

// Create joint
b2RopeJoint* bodyAbodyBJoint = (b2RopeJoint*) world->CreateJoint(&jd); 

// Create batchnode and vrope for joint (can also be made between two bodies)
CCSpriteBatchNode* batch = dynamic_cast<CCSpriteBatchNode*> (getChildByTag(KTagRopeBatchNode));
VRope* verlet = new VRope(bodyAbodyBJoint, batch); 

Updating (called from update loop)

// Update the verlets in the game loop
verlet->update(dt);
verlet->updateSprites();

See more usage examples from the original authors pages.