Game Development Community

Hero Tracer 2D

by rennie moffat · in Torque Game Engine · 07/19/2009 (10:14 am) · 2 replies

HI, I would like to make a tracer that would follow my hero, and would be variant on acceleration. EX. I drag my player to the right at X speed the tracer follows behind. and coils up in, disappears when the player stops. If I move him faster, the tracer is more spread out, but eventually catches up and recoils when the player stops, hits zero acceleration


Any tips?

About the author

My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.


#1
07/20/2009 (10:02 am)
ok, so i have thought about this more. Originally I thought just have a particle effect but I could not get it to work properly, to my visual tastes. I know a simple (loading type ie face book loader) animation would do, the trick is that it must rotate for when the hero moves up, down, left right, the tracer must trail appropriately.
And I am unsure how to do this. Is there a simple way, with out major coding to do this?



#2
07/20/2009 (10:16 am)
ok so i am thinking this code may work in terms of the direction, tho it is not nailed yet.


function PlayerClass::onAddToScene(%this, %scenegraph)
{
...
// Register Animation States.
%this.registerAnimationState( "up" );
%this.registerAnimationState( "down" );
%this.registerAnimationState( "left" );
%this.registerAnimationState( "right" );
...
}

function PlayerClass::enterUpAnimationState(%this)
{
return "upAnimation";
}

function PlayerClass::executeUpAnimationState(%this)
{


}





My question is, with in the execute function, what should I declare? what the actual up animation is? I don't think so. Is it the movement of the mouse? Anything? this is where I am getting lost.