actually I got that wrong, here is the modified code that makes it turn more quickly and reponsive as we move closer:
I just multiply a#
however it really jitters badly if you go up then down - any idea how to fix?
d# = Sqr((mx-px)^2 + (my-py)^2) If d#>l dx# = ((mx-px)/d)*l dy# = ((my-py)/d)*l px# = mx - dx py# = my - dy ElseIf d#<l a# = ATan2(mx-px,my-py)* 1.02 px# = mx + Sin(-a)*l py# = my - Cos(-a)*l End If
I just multiply a#
however it really jitters badly if you go up then down - any idea how to fix?