Well, if you're using DBPro then what you need is a GetSpriteAngle() function:
function GetSpriteAngle(spr1,spr2)
cx# = sprite x(spr1) : cy# = sprite y(spr1)
x# = sprite x(spr2) : y# = sprite y(spr2)
ang# = 180 + atanfull(cx#-x#,y#-cy#)
endfunction ang#
...where spr1 is a center sprite and spr2 is a sprite positioned somewhere around the center sprite. The angle returned can be used to set the sprite rotation.
A small demo:
Move the circle with the mouse and the arrow will always point to it.
sync on : sync rate 40
hide mouse
cls 0
line 8,31,16,0 : line 16,0,24,31 : line 24,31,8,31 : get image 1,0,0,32,32,1
cls 0
circle 16,16,15 : get image 2,0,0,32,32,1
cls 0
sprite 1,320,240,1 : offset sprite 1,16,16
sprite 2,0,0,2 : offset sprite 2,16,16
do
sprite 2,mousex(),mousey(),2
a# = GetSpriteAngle(1,2)
rotate sprite 1,a#
sync
loop
function GetSpriteAngle(spr1,spr2)
cx# = sprite x(spr1) : cy# = sprite y(spr1)
x# = sprite x(spr2) : y# = sprite y(spr2)
ang# = 180 + atanfull(cx#-x#,y#-cy#)
endfunction ang#
Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.