ackvonhuelioLvl 41
- Edited
- Best Answerset by pluto
to find the direction(angle) between two points:
var angle = atan2(target.y-subject.y,target.x-subject.x);
to have the subject move at that angle:
subject.x += cos(angle)*speed;
subject.y += sin(angle)*speed;