An intriguing challenge with physics

Blitz3D Forums/Blitz3D Programming/An intriguing challenge with physics

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

actually I got that wrong, here is the modified code that makes it turn more quickly and reponsive as we move closer:

	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?