1試合やってます。体が作成されたその動く少年スプライトで。男の子の体は、前側または後ろ側に移動すると倒れます。
体の y 軸 0 をどのように修正しますか?
CCSprite *boySprite=[CCSprite spriteWithFile:@"object_boy.png"];
boySprite.position=ccp(100,50);
b2BodyDef boyBodyDef;
boyBodyDef.type = b2_dynamicBody;
boyBodyDef.linearDamping = 1;
boyBodyDef.angularDamping = 1;
boyBodyDef.position.Set(25.0f/PTM_RATIO,(150)/PTM_RATIO);
boyBodyDef.angle=0;
boyBodyDef.userData = _boy;
boyBody = world->CreateBody(&boyBodyDef);
b2PolygonShape boyBox;
b2FixtureDef boyBoxDef;
boyBoxDef.shape = &boyBox;
boyBoxDef.density = 0.5F;
boyBox.SetAsBox(11.0f/PTM_RATIO, 30.0f/PTM_RATIO);
boyFixture = boyBody->CreateFixture(&boyBoxDef);
[self addChild:boySprite z:1];