How can I make a b2Body move in a arc-like or curved path? I have heard about cocos2d Bezier curve function (ccBezier) but this is for moving cocos2d sprites. Or can it be modified to move box2d bodies? Any help is appreciated. Thank you.
Tell me more
×
Game Development Stack Exchange is a question and answer site for
professional and independent game developers. It's 100% free, no registration required.
|
|
For box2d with gravity enabled, if you apply force to an object in the upwards direction, you will automatically get a parabolic trajectory. Create a b2vec2 and apply that as the force to your body. If you want to move the body or sprite manually, then use parabolic formulas to calculate your position in your update method. |
|||