Angle_difference - hpgDesigns/hpgdesigns-dev.io GitHub Wiki
Description
Calculates the difference between two angles and returns the result.
Parameters
Parameter | Data Type | Description |
---|---|---|
ang1 | double | the first angle, in degrees |
ang2 | double | the second angle, in degrees |
Return Values
double: Returns the difference between the two angles, between -180 and 180.
Example Call
// demonstrates getting the difference between the calling instance and the position of an instance of the enemy object
var inst, diff;
inst = instance_nearest(x, y, obj_enemy);
diff = angle_difference(direction, point_direction(x, y, inst.x, inst.y));
NOTOC