This is a follow-up to My X-code cannot find CCRibbon.
It seems that the CCRibbon class has been deprecated in v2 of Cocos2d. I want to use essentially this exact functionality. I have a sprite that animates around the scene, I would like a line to follow the sprites movements (similar to LOGO pen up/pen down).
Currently I'm overriding the update method of my animation to return its starting and ending position. Then I'm drawing a line (based on a 1x1 texture) and adding it to a CCSpriteBatchNode each time the animation updates. (I can add more sample code if anyone is interested).
My current solution works alright but it's kind of high overhead and is not always very consistent. Before working on improving it I wanted to see if there was a known best practice for this sort of thing.
You could use CCMotionStreak for this.
I found this tutorial which sounds similar to what you want to do. http://www.supersuraccoon-cocos2d.com/2011/11/03/ensimple-line-follow-demo-ccmotionstreakzh-ccmotionstreakja-ccmotionstreak/