' Challenge of the month August 2012 Animal shapes naochanON
' Whale sharks
sharkdata()
makeshape()
For i=1 to 3
reposition()
endfor
While "true"
For i=1 To 3
If Shapes.GetLeft(stri[i][14])+200*i<-50 Then
reposition()
EndIf
EndFor
move()
Program.Delay(80)
endwhile
Sub reposition
x0=1000+300*i
y1=shapes.GetTop(stri[i][2])
y0=math.GetRandomNumber(325)*(325-y1)/math.abs(325-y1)
'-------------------------- body --------------------------
For j=1 To 16
Shapes.Move(stri[i][j],shapes.GetLeft(stri[i][j])+x0,shapes.GetTop(stri[i][j])+y0)
endfor
'-------------------------- mouse Eyes --------------------------
For k=1 To 5
Shapes.Move(sEl[i][k],shapes.GetLeft(sEl[i][k])+x0,shapes.GetTop(sEl[i][k])+y0)
endfor
For L=1 To 35
Shapes.Move(sdEl[i][L],shapes.GetLeft(sdEl[i][L])+x0,shapes.GetTop(sdEl[i][L])+y0)
endfor
GraphicsWindow.Show()
EndSub
Sub move
For i=1 To 3
dx=math.GetRandomNumber(8)-2
dy=(math.GetRandomNumber(8)-4)
Op=(3+math.GetRandomNumber(2))/6
dy=dy/10
'-------------------------- body --------------------------
For j=1 To 16
Shapes.Move(stri[i][j],Shapes.GetLeft(stri[i][j])-dx,Shapes.Gettop(stri[i][j])+dy)
endfor
For j=10 To 14
Shapes.rotate(stri[i][j],-op*6) ' moving tail
EndFor
'-------------------------- mouse Eyes --------------------------
For k=1 To 5
Shapes.Move(sEl[i][k],Shapes.GetLeft(sEl[i][k])-dx,Shapes.Gettop(sEl[i][k])+dy)
endfor
Shapes.Zoom(sEl[i][3],1,op) ' moving mouth
For L=1 To 35
Shapes.Move(sdEl[i][L],Shapes.GetLeft(sdEl[i][L])-dx,Shapes.Gettop(sdEl[i][L])+dy)
endfor
EndFor