I was looking for slash effect when the user swipe his finger on screen that will look like Fruit Ninja (arrow shape getting thinner).
CCMoitionStreak wasn’t very satisfying - it was too sharp in the corners, it didn’t has an arrow shape and didn’t get thinner.
So I found CCBlade here:
I ported it to C++ and test it in Marmalade platform, the results are great!
here you can see it in action in my game, Rolly Poly:
The code, of course, is attached. the usage is very simple - just add TouchTrailLayer::node() to your scene as a child.
Big thanks to Ngo Duc Hiep who wrote this wonderful class in the first place.
P.S - there might be a small memory leak, I didn’t find it yet, if anyone will find something, please post it here.
(ignore .h and .cpp attached files, the updated version is attached - ccblade.zip)
streak1.png (1.4 KB)
CCBlade.cpp.zip (2.3 KB)
CCBlade.h.zip (1.2 KB)
TouchTrailLayer.cpp.zip (1.4 KB)
TouchTrailLayer.h.zip (1.0 KB)
ccblade.zip (5.9 KB)