Moving along a line

BlitzMax Forums/BlitzMax Beginners Area/Moving along a line

For some reason the image stays 1 pixel behind the next set of co-ords until tween reaches 0.5.
Function TweenLinear#(X1#, X2#, Tween#)
		
			Value = Float(X1# + Float(Tween# * Float(X2# - X1#)))

			Return Value
			
End Function

Graphics 640,480,16,2
SetBuffer BackBuffer()


Function create_bloke(name$)
a=CreateImage(StringWidth (name),StringHeight(name))
SetBuffer ImageBuffer(a)
Text 0,0,name
SetBuffer BackBuffer()
Return a
End Function

Type bloke
Field x
Field y
Field speed#
Field tween#
Field image_handle
End Type

b.bloke=New bloke
b\image_handle=create_bloke("trev")
b\speed=.001
b\tween=0

Global destinationx=50
Global destinationy=50

While Not KeyDown(1)
Cls
For b.bloke=Each bloke
b\tween=Float(b\tween+b\speed)
b\x=tweenlinear(b\x,destinationx,b\tween)
b\y=tweenlinear(b\y,destinationy,b\tween)
DrawImage b\image_handle,b\x,b\y
If b\x=destinationx And b\y=destinationy
RuntimeError "arg"
EndIf
Next
Flip
Wend
End

speed has been tested with different values but a similar result happens with all values.