I want to accomplish the effect that similar to waving knife in fruit ninja. Can particle effect meet my needs? If not, what's the correct solution? I think the effect of fruit ninja is very good, which can give response according to your speed. It's very cool. How to achieve this effect?
How to accomplish the effect of waving knife similar to fruit ninja?
(8 posts) (6 voices)-
Posted 1 year ago #
-
Maybe try the CCRibbon and CCMotionStreak classes?
Posted 1 year ago # -
CCMotionStreak is not good enough to accomplish it. RenderTextureTest draws smoother than CCMotionStreak, but fps drops to 35. Who can give me a tip?
Posted 1 year ago # -
not me, but I am interested also...the "slash" effect seems to close itself up - which I have often pondered when I payed it
Posted 1 year ago # -
You should be able to get that exact effect with a motion streak, however, you'll need to do a bit of work on the class itself as I never got to fixing the overlap issues when turning. You'll need to add a test that checks to see if only one of the newly created vertex's is in front of the previous edge, and if so clamps the one that's behind the edge to the previous vertex position.
You can also scale the width of the motion streak as you move it, which will give you the closing up effect.
A render to texture is going to be way too slow for this effect, as you'll be drawing the entire scene for what is a small drawing area.
Posted 1 year ago # -
Hi @slipster216, thanks for your advice. It's very helpful.
To be different with Ninja, I need the slash remaining in the screen until I raise my finger. But I found the slash in Ninja and the trace in motion streak is not smooth enough, especially when I draw a circle using it. In fact, the user always to be expected to draw a circle in my game. I think the key is the streak.png that is used in MotionStreakTest.m. It cannot be a a round shape, otherwise the trace of motion streak will be broken. All I need is the user can draw a smooth circle with linear gradient and the closing up effect like Ninja with his/her finger. Can you give me more tips?Posted 1 year ago # -
Hi,
I implemented the similar effect by drawing with OpenGL. It still has some weird bugs but it's nice and quit flexible. You can design your own texture and set it to the blade. Source code can be found here https://github.com/hiepnd/CCBlade.Posted 1 year ago # -
A bit late but thank you hiepnd for the source very helpful!
Posted 7 months ago #
Reply
You must log in to post.