'Set color to each line:
colors = "0=DarkRed;1=Red;2=Tomato;3=Cyan;4=DodgerBlue;5=Blue;6=Navy;7=DarkRed;"
colorsIndex = Array.GetItemCount(colors) - 2 '# of colors = # of lines to draw at each row
angStep = 360/(colorsIndex + 2) 'Set angle step diff. for all lines
'Store all calcs in array x[ang][y][line]:
For ang=0 To angMax 'Angle loop
amp = Math.Sin(ang)*gh + twist 'Set the amplitude and change it based on gh & ang
For y=0 To gh Step sharp 'Row loop
calc = y/amp + ang 'Pre-calc
For line=0 To colorsIndex - 1 'Line loop
x[ang][y][line] = Math.Sin(calc + angStep*line)*size + set 'Set coordinates to draw each line
EndFor
x[ang][y][line] = x[ang][y][0] 'Last line = 1st line
EndFor
EndFor
'Main twister routine
Twist:
For ang=0 To angMax
For y=0 To gh Step sharp
xx = x[ang][y] 'Creates a 1D sub-array outta x[ang][y]
x1 = xx[0] '1st coordinate
For line=0 To colorsIndex
x2 = xx[line+1]
If x1
GraphicsWindow.PenColor = colors[line]
GraphicsWindow.DrawLine(x1,y x2,y)
EndIf
x1 = x2 'Now 1st coordinate = last used 2nd coordinate
EndFor
EndFor
'Delay before clearing the screen:
Program.Delay(delay)
GraphicsWindow.Clear()
EndFor