It's not really simple math
NPC Code:
radangle = random(0,2*3.14);
dx = cos(radangle);
dy = -sin(radangle);
move dx*5,dy*5,5,16;
3.14 = pi
It's dy = -sin(radangle) because when
the angle is pi/2 (90 degrees) then it should
move up, so sin(90) = 1 needs to move the
npc up which means y needs to be decreased