Getangle

From EDukeWiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

getangle <return> <x> <y>

Returns the angle formed by the displacements <x> and <y>.

In most languages this function is known as arctan2.

Examples

To make one actor face another some subtraction is involved.

set X sprite[OTHER_SPRITE].x
set Y sprite[OTHER_SPRITE].y
sub X sprite[].x
sub Y sprite[].y
getangle ANG X Y