to find the direction:
var dir = atan2(target.y-player.y,target.x-player.x);
atan2(y2-y1,x2-x1) returns the direction from (x1,y1) to (x2,y2) as an angle(0-360).
to make the projectile move at this angle:
projectile.x += cos(dir);
projectile.y += sin(dir);