Hi,
How can you identify the sprite associated with a particular body while using box2D ? Sometimes you may need to identify the sprite associated with the body you are using. For that use the following line of code.
CCSprite *yourSprite= (CCSprite*)yourBody->GetUserData(); |
Now you got the corresponding sprite in your ‘yourSprite’
You’ve got great insights about body, keep up the good work!