#define center_x(O) (O:x*TILE_WIDTH + (ismovable(O) ? O:step_x + O:bound_x + O:bound_width/2 - 1 : floor(TILE_WIDTH/2)-1))
#define center_y(O) (O:y*TILE_HEIGHT + (ismovable(O) ? O:step_y + O:bound_y + O:bound_height/2 - 1 : floor(TILE_HEIGHT/2)-1))
proc
atan2(x,y)
return (x||y)&&(y>=0 ? arccos(x/sqrt(x*x+y*y)) : 360-arccos(x/sqrt(x*x+y*y)))
get_angle(atom/a,atom/b)
. = atan2(center_x(b) - center_x(a), center_y(b) - center_y(a))
get_angle_projectile(atom/a,atom/b)
. = atan2(center_y(b) - center_y(a), center_x(b) - center_x(a))
I cannot explain why, but my projectiles only shoot correctly with the x, y values reversed in atan2(), hence the two separate angle retrieving procs. I've tried many modifications and no luck.
Here's a video of the problem in action.
Is anyone willing to point out what the problem is and why?
Thanks.