angle help please

BlitzMax Forums/BlitzMax Programming/angle help please

The Angle Between Two objects is calculated with

ATan2(TargetY - SourceY, TargetX - SourceX)

So find the difference by subtracting from the angle of the source car. But bear in mind that you'll want to keep your angle difference between 180 and -180 in order to prevent from going the long way instead of the short way. So if it's higher than 180 or lower than -180 then add/subtract 360 to ensure that it isn't.