edh wrote:Or you could start the bullet from a position not at 0,0 but something near the middle of the cannon actor.
double xdist(double angsize, double dist)
{
return cos(degtorad(angsize)) * dist;
}
double ydist(double angsize, double dist)
{
return sin(degtorad(angsize)) * -dist;
}
xdist(<angle you want to use>, <radius of circle>);
double xpos = xdist(dir, 100);
double ypos = ydist(dir, 100);
CreateActor("bullet"... xpos, ypos, false);
Users browsing this forum: No registered users and 1 guest