i'm trying to do arrows(like those that are used with a bow), but, i don't know how to do them.
my actual code is something like this
this is called every frame.
however, is highly innacurate.
i tryed searching, but all the matches seemed to point to keyboard arrows, perhaps i didn't search well.
can someone give me some example working code, or at least some tips on how to do this?
thanks you very much :3
and, also, sorry my bad english.
my actual code is something like this
Code:
private function correct():void {
var velocidad:b2Vec2 = b2body.GetLinearVelocity();
var angulo:Number= Math.atan2( velocidad.y, velocidad.x )
b2body.SetXForm(b2body.GetPosition(), angulo);
}
var velocidad:b2Vec2 = b2body.GetLinearVelocity();
var angulo:Number= Math.atan2( velocidad.y, velocidad.x )
b2body.SetXForm(b2body.GetPosition(), angulo);
}
this is called every frame.
however, is highly innacurate.
i tryed searching, but all the matches seemed to point to keyboard arrows, perhaps i didn't search well.
can someone give me some example working code, or at least some tips on how to do this?
thanks you very much :3
and, also, sorry my bad english.