gettargetangle

From ZDoom Wiki

Jump to: navigation, search
This function acts as an exstension to VectorAngle, it returns the relative angle of a thing with tid2, from a thing with tid1.
function int GetTargetAngle (int tid1, int tid2)
{
    int x, y;
    x = GetActorX(tid2) - GetActorX(tid1);
    y = GetActorY(tid2) - GetActorY(tid1);
    return VectorAngle(x, y);
}
Personal tools