i use these functions in my boinkadroid game for my turrets.
The point to command can you simply adjust with -90 or something if it points wrongly.
function Point_TO(id,x#,y#,x2#,y2#)
sprite_new_angle# = atanfull(x2#-x#,y2#-y#)
SetSpriteAngle(id,sprite_new_angle#)
endfunction
function Move_To( id , originalX# , originalY# , destinationX# , destinationY# , move# )
ontarget=0
distanceX# = destinationX# - originalX#
distanceY# = destinationY# - originalY#
distanceFromAtoB# = sqrt ( ( distanceX# * distanceX# ) + ( distanceY# * distanceY# ) )
if ( distanceFromAtoB# <> 0.0 )
directionX# = distanceX# / distanceFromAtoB#
directionY# = distanceY# / distanceFromAtoB#
endif
if ( move# > distanceFromAtoB# ) or (distanceFromAtoB#<move#)
ontarget=1
//ExitFunction ontarget
endif
if ontarget=0
// work out new location
newX# = originalX# + directionX# * move#
newY# = originalY# + directionY# * move#
// update position of our sprite
SetSpritePosition ( id , newX#, newY# )
endif
endfunction ontarget