I created 2 body2d body with cocos2d sprite .... they have different masses and they fall from the same place in the world. but they fall at the same time. my idea is that a lighter body should fall later than a heavy ... but they did not.
for (int k=1;k<=2; k++) { int idx = (CCRANDOM_0_1() > .5 ? 0:1); int idy = (CCRANDOM_0_1() > .5 ? 0:1); CCSprite *sprite = [CCSprite spriteWithBatchNode:batch rect:CGRectMake(32 * idx,32 * idy,32,32)]; [batch addChild:sprite]; sprite.position = ccp( p.x+(32*k), py); b2BodyDef bodyDef; bodyDef.type = b2_dynamicBody; bodyDef.position.Set(( p.x+(32*k))/PTM_RATIO, py/PTM_RATIO); bodyDef.userData = sprite; b2Body *body = world->CreateBody(&bodyDef); b2PolygonShape dynamicBox; dynamicBox.SetAsBox(.5f, .5f);
source share