Cocos2dx – Trail

| | August 4, 2015

I’d like to implement a trail (like the white circles in Angry Birds) that chase my Sprite. I already used CCMotionStreak, but the trail texture is “stretched” instead.

Anyone has an idea how to make this?

One Response to “Cocos2dx – Trail”

  1. There are a few ways to do this. One would be to continuously store your sprites position points in an array that’s updated to hold the last 20 positions or so depending how many you need for your trail. Then you can simply apply white circle sprites(or whatever you want the trail to be made of) on to only the current points in that array or every other current point in that array depending on the spacing you want. If you are using the update method to store your sprite position points remember to fix your time step or the position points might not be evenly distributed.

Leave a Reply