adding curved movement

BlitzPlus Forums/BlitzPlus Programming/adding curved movement

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.

Hi, I have made this intro effect that takes a picture and cut it in boxes 16x16 pixels. And then it places these boxes randomly on the screen and moves them back to their original place. But the thing is, that it moves the boxes straight to their place and I would like to add a curved movement or something to make it look a little more interesting. If you have any ideas please feel free to comment. Here is the code:

;// FULL SCREEN PICTURE EFFECT

; SET GRAPHICS MODE
Graphics 640,480

; LOAD STUFF
picture = LoadImage("das3.jpg") ;change filename to any 640x480 picture

;// SETUP VARIABLES

Dim expos(1200),eypos(1200)
Dim cxpos(1200),cypos(1200)

x=0
y=0
For a=0 To 1199
expos(a)=x
eypos(a)=y
x=x+16
If x>624 Then
x=0
y=y+16
End If
cxpos(a)=Rnd(623)
cypos(a)=Rnd(463)
Next

;// SETUP MOUSE CHECK

mx1=0
mx2=MouseX()

; Go double buffering
SetBuffer BackBuffer()

While Not KeyHit(1)

mx1=MouseX() : If mx1<>mx2 Then End ; if mouse is moved then end program

For a=0 To 1199
CopyRect expos(a),eypos(a),16,16,cxpos(a),cypos(a),ImageBuffer(picture),BackBuffer()
If cxpos(a) <> expos(a) Then
If cxpos(a) < expos(a) Then cxpos(a) = cxpos(a) + 1
If cxpos(a) > expos(a) Then cxpos(a) = cxpos(a) - 1
End If
If cypos(a) <> eypos(a) Then
If cypos(a) < eypos(a) Then cypos(a) = cypos(a) + 1
If cypos(a) > eypos(a) Then cypos(a) = cypos(a) - 1
End If
Next

Flip ; show backbuffer
Cls ; Clear screen

Wend

End

;// END OF CODE