Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
Why not just model a parabola and apply the necessary force? You get such an effect coming out of a cannon (arc). – Vaughan Hilts Aug 29 '12 at 19:59
@VaughanHilts: I am not sure how to model a parabola – colilo Aug 29 '12 at 23:10
Give your world a somewhat realistic gravity force. Then just apply an impulse at some angle. Box2D models real world physics and you're projectile will travel in a parabola just like real life. – Amplify91 Sep 14 '12 at 18:29

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.

share|improve this answer
Good answer, but it is highly NOT recommended to move the body manually. Just thought it was worth mentioning :) – Amplify91 Sep 14 '12 at 18:30
Thanks, yes I agree. Tried it once and updates were jittery. – magdalina Sep 14 '12 at 19:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.