Graphics 640,480
SetBuffer BackBuffer()
SeedRnd MilliSecs()
img=LoadImage("hill_castle.jpg")
img_grab=CreateImage(320,240)
x=Rand(320)
y=Rand(240)
dx=1
dy=1
Repeat
SetBuffer ImageBuffer(img)
GrabImage img_grab,x,y
SetBuffer BackBuffer()
DrawBlock img_grab,0,0
Flip
x=x+dx
If x<0 Then x=Rand(0,1):dx=1
If x>320 Then x=320:dx=-1
y=y+dy
If y<0 Then y=Rand(0,1):dy=1
If y>240 Then y=240:dy=-1
Until KeyHit(1)
End