Pergunta

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!

Foi útil?

Solução

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.

Outras dicas

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top