Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I want to move a ccsprite object along a pre defined path. ( Similar to motion guide in flash) Is there any tool i can use to create this path?

share|improve this question
I can not see the post and the Demo by Lam. This post is related to exactly what I need. But the links given are not working for me :( –  user23315 Nov 25 '12 at 15:09
add comment

2 Answers

up vote 1 down vote accepted

Read through this forum post. "Lam" posted a small library to draw several curve-types (cubic and quad bezier, cubic and quad lagrange) in cocos2d. Another post describes how you can calculate the rotation of your sprite.

share|improve this answer
I am not looking for curve types, but a way to draw a path , which can be exported and then used by a cocos2d function to move a sprite along the path. –  guru Mar 9 '11 at 18:25
A path is just a series of control points. With the functions provided in the links you can easily draw a path and/or make a sprite move along this path. If don't think there's anything like in flash for cocos2d (where you directly paint a path and your movieclip follows that). –  bummzack Mar 9 '11 at 22:28
The demo from "Lam" had larange curves which is very close to what i was looking for, as they draw a curve going thru all control points unlike bezier. –  guru Mar 12 '11 at 21:42
add comment

i've created this small code generator to create motion code from a curve drawing: http://hezicohen.com/stv_beta/curveEditor.html

share|improve this answer
that is an excellent one. Bravo. I really liked that one. –  Sagar R. Kothari Aug 14 '12 at 18:49
add comment

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.