سؤال

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!

هل كانت مفيدة؟

المحلول

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.

نصائح أخرى

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top