
where the ship rotates right and the target does the same, or where the bullet can shoot at the many different angles. like in a normal astroids game. to where instead of shooting up down left an right, it can shoot at all angles like 45o an stuff, i hope u know what i mean


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