Really simple thing....

Blitz3D Forums/Blitz3D Beginners Area/Really simple thing....

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.

I'm trying to make a code to make a rectangle go to where ever I right click, but not instantly I want it slowly at a certain speed to go there, anyone got an example I doubt my code is that good...

Graphics 800,600,32

SetBuffer BackBuffer()

Global Rx% = 10
Global Ry% = 10
Global goX%, goY%

Repeat
Cls
Mx% = MouseX()
My% = MouseY()

Rect Rx%, Ry%, 100, 100, 0

If MouseHit(2) Then
	goX% = Mx%
	goY% = My%
EndIf
If Not Rx%=goX% And Ry%=goY% Then
; // Do this to get to the cordination?
EndIf
Flip
Until KeyHit(1)
End