Creation of an hook using Nape Physics Engine and Distance Joint

Since the creation of a Box2D hook like the one seen on iOS Mikey Hooks game was quite interesting, I got some message and email asking me to do the same thing with Nape Physics Engine which seems to perform better on mobile devices.

Here it is, I kept the same comments and the same function name and order to let you compare the scripts:

And this is the result:

Click and hold your mouse over a static body to create a hook and rewind it, release mouse button to destroy the hook. Try to swing like a tarzan geek, again

Download the source code. Which one would you use? Nape or Box2D?

  • napeWorld.constraints.remove(distanceJoint);
    better way: distanceJoint.space = null

  • Chason

    Anyway to skin the distancejoint?