How to put a trail in some circumstances


(Enzo M) #1

Hello everybody,

I got a question about something that looks like weird and kind of hard to do for me.

I got a sprite for my game, this one : http://puu.sh/5P6cM.jpg , which is a magnet the player can launch to ennemies etc. To put a “speed” sensation when launching this, I would like to add a trail behind it.

I actually got an animation for it : http://puu.sh/5P6fV.jpg , which is rebooting every last frame, since it is just a feedback for the player to notice it actually attracts others elements.

Thing is, I can’t put a new animation with a trail on it, since I can’t manage the rebooting of the animation precisely because I don’t know WHEN my chip will stop moving : indeed, the player chose where he want to put it by left-clicking, but the distance is never the same between the player and the item.

Thanks for helping me, Regards, Enzo


(Zachary Lewis) #2

You can draw your sprite to a buffer and fade it out each frame to give it a sense of motion blur. That way, you don’t have to worry about adding multiple entities for a trail and keeping track of them.