0
votes

the cocos2d tank As the picture shows. How can I make part A stick intensely with part B ? to make a tank body ?

contex shape is OK but cancerve is not . so I want to make two parts stick together and move....

Thanks in advance. PS I am using cocos2d v3 , it is chipmunk encapsulated with cocos2d, no Box2D here..

=============

Now I have resolved the issue . use Shapes list can do . But new questions comes : how can I put the gun on tank ? pivot body can rotate some angle but not 360.

there are only 4 connects in CCPhysicsJoint:

+(CCPhysicsJoint *)connectedPivotJointWithBodyA:(CCPhysicsBody *)bodyA bodyB:(CCPhysicsBody *)bodyB anchorA:(CGPoint)anchorA;

+(CCPhysicsJoint *)connectedDistanceJointWithBodyA:(CCPhysicsBody *)bodyA bodyB:(CCPhysicsBody *)bodyB
    anchorA:(CGPoint)anchorA anchorB:(CGPoint)anchorB;

+(CCPhysicsJoint *)connectedDistanceJointWithBodyA:(CCPhysicsBody *)bodyA bodyB:(CCPhysicsBody *)bodyB
    anchorA:(CGPoint)anchorA anchorB:(CGPoint)anchorB
    minDistance:(CGFloat)min maxDistance:(CGFloat)max;

+(CCPhysicsJoint *)connectedSpringJointWithBodyA:(CCPhysicsBody *)bodyA bodyB:(CCPhysicsBody *)bodyB
    anchorA:(CGPoint)anchorA anchorB:(CGPoint)anchorB
    restLength:(CGFloat)restLength stiffness:(CGFloat)stiffness damping:(CGFloat)damping;

no one fit.

And my question is , can I rotate a angle on a shape in shape-arranged body ?

1

1 Answers