Question

I'm looking for "MouseJoints" or an equivalent in the new version of cocos2d (3.0) for iOS which use the Chipmunk physics library instead of Box2d. Is there anything like this? Thanks in advance!

Était-ce utile?

La solution

For our tutorial chapter on firing a catapult by touch interaction I use a regular CCNode that follows the user's touches and create a joint between that Node and the catapult arm.

This sufficiently replaces a MouseJoint.

Autres conseils

I used this is how I implemented it and posted on rotategears blog.

Basically I created a sprite that represents the user input and made the sprite follow the users touch points. Make sure to remove the joint at TouchEnded.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top