Game Development Community

how to render light knife just like fruit ninja?

by tianjie_gs · in iTorque 2D · 06/30/2011 (12:57 am) · 4 replies

Hi, I am new to iTorque2D, but has experience on coding game. I wondering if torque has the convenient object to render the light knife effect as I say like the fruit ninja's drag effect?
Or something else can instead of, like particles or ribbon?

#1
07/02/2011 (12:28 pm)
Particles makes the most sense to me, if you want to get started quickly. Your other option is to create a custom render object that trails during a drag. This would definitely require source modifications, but it could be more performant than a lot of particles.
#2
07/03/2011 (8:36 am)
yah I was thinking, some type of object that would trail your finger movement. It would have to have some type of schedule to fade over time, and also, thin out, thickening toward the finger. not sure really, but if you put some thought into it you could come up with something.



#3
07/04/2011 (7:32 am)
en,I know a way to render it but need to use opengl api, I want write a object that will render each game loop,but I am new to torque, I find maybe I can extend the StaticSprite and override its render function(in c++), I am not sure, can anybody give me a advise?
#4
07/05/2011 (10:48 pm)
I mean I need some guide to create a new staticSprite that will render the knife trace by the drag motion, if I extend from StaticSprite Class how to call it in my iTGB and also can use script to control its behavior?
The main point is how to use my c++ code in iTGB....