Sgt. Sparky wrote:sorry to double post but: how do i use the "directional_velocity" code? to make my actow when i press up to go forwards even if its facing left? um... could you help me?
directional_velocity = 5;
angle = 90; //up
double xdist(int deg, double dist)
{
return dist * cos(degtorad(deg));
}
double ydist(int deg, double dist)
{
return -dist * sin(degtorad(deg));
}
xvelocity *= .99;
yvelocity *= .99;
int dir = animpos * 10;
xvelocity += xdist(dir, .1);
yvelocity += ydist(dir, .1);
xvelocity *= .95;
yvelocity *= .95;
Users browsing this forum: No registered users and 1 guest