'Optical illusions all-in-one; requires FC extension; by Vitexikora
GraphicsWindow.Hide()
illtext[1] = "Focus on any of the white balls. You will see the others black. /*by litdev*\"
illtext[2] = "Is the umbrella rotating? No!, focus on one line. Still rotating? Add a finger by the screen, you will see it static. /*by litdev*\"
illtext[3] = "Is it really a square ? /*by litdev*\"
illtext[4] = "If you look at the centre cross, it appears that a green 'ghost' dot appears in the space. /*by litdev*\"
illtext[5] = "The 'blue' and 'green' are both the same colour (Cyan). I know it is hard to belive, but check it yourself. /*by litdev*\"
illtext[6] = "Are the lines collinear ? /*by litdev*\"
illtext[7] = "The thick line in the center seems to be light to dark, but it is of one color /*by Vitexikora*\"
igw=500
igh=500
GraphicsWindow.Title="Optical Illusions"
Controls.LoadTheme("XPRoyale")
DrawGW()
GraphicsWindow.KeyDown=OnKeyDown
GraphicsWindow.Show()
Sub illusion1
ClearMenuGW()
gw=500
gh=gw
GraphicsWindow.BackgroundColor = "Gray"
GraphicsWindow.BrushColor = "Black"
For i = 1 To 8
For j = 1 To 8
GraphicsWindow.FillRectangle((i-1)*gw/8+5,(j-1)*gw/8+5,gw/8-10,gw/8-10)
EndFor
EndFor
GraphicsWindow.BrushColor = "White"
For i = 1 To 7
For j = 1 To 7
GraphicsWindow.FillEllipse(i*gw/8-7,j*gw/8-7,14,14)
EndFor
EndFor
EndSub
GraphicsWindow.BrushColor = "Magenta"
For i = 1 To 12
ball[i] = Shapes.AddEllipse(40,40)
theta = i*2*Math.Pi/12
x = gw/2+200*Math.Cos(theta)
y = gh/2+200*Math.Sin(theta)
Shapes.Move(ball[i],x-20,y-20)
EndFor
While(status="go!")
For i = 1 To 12
Shapes.HideShape(ball[i])
Program.Delay(150)
Shapes.ShowShape(ball[i])
EndFor
EndWhile
EndSub
For row = 1 To 10
y = (row-1)*50
For col = 1 To 50
x = (col-1)*10
rem = Math.Remainder(row,4)
If (rem = 0) Then
GraphicsWindow.BrushColor = "Magenta"
GraphicsWindow.FillRectangle(x,y,5,gh/10)
GraphicsWindow.BrushColor = "Orange"
GraphicsWindow.FillRectangle(x+5,y,5,gh/10)
ElseIf (rem = 1) Then
GraphicsWindow.BrushColor = "Magenta"
GraphicsWindow.FillRectangle(x,y,5,gh/10)
GraphicsWindow.BrushColor = "Cyan"
GraphicsWindow.FillRectangle(x+5,y,5,gh/10)
ElseIf (rem = 2) Then
GraphicsWindow.BrushColor = "Magenta"
GraphicsWindow.FillRectangle(x,y,5,gh/10)
GraphicsWindow.BrushColor = "Orange"
GraphicsWindow.FillRectangle(x+5,y,5,gh/10)
Else
GraphicsWindow.BrushColor = "Cyan"
GraphicsWindow.FillRectangle(x,y,5,gh/10)
GraphicsWindow.BrushColor = "Orange"
GraphicsWindow.FillRectangle(x+5,y,5,gh/10)
EndIf
EndFor
EndFor
EndSub
Sub illusion6
ClearMenuGW()
GraphicsWindow.BackgroundColor = "Gray"
For row = 1 To 20
For col = 0 To 10
x = (col-1)*50+2
y = (row-1)*25+2
If (Math.Remainder(row,2) = 1) Then
x = x+12
EndIf
GraphicsWindow.BrushColor = "Black"
GraphicsWindow.FillRectangle(x,y,23,23)
GraphicsWindow.BrushColor = "White"
GraphicsWindow.FillRectangle(x+25,y,23,23)
EndFor
EndFor
EndSub
Sub illusion7
ClearMenuGW()
GraphicsWindow.PenWidth = 2
GraphicsWindow.BackgroundColor = "Gray"
For i=0 To 450
GraphicsWindow.PenColor = GraphicsWindow.GetColorFromRGB(0+(i/(450/255)),0+(i/(450/255)),0+(i/(450/255)))
GraphicsWindow.DrawLine(25+i,25,25+i,475)
EndFor
GraphicsWindow.BrushColor="Gray"
GraphicsWindow.FillRectangle(40,230,420,40)
EndSub
Sub ClearMenuGW
For w=1 To 7
Controls.Remove(butt[w])
EndFor
GraphicsWindow.Clear()
EndSub
Sub OnKeyDown
If GraphicsWindow.LastKey="Escape" Then
prevstat=status
status="stop!"
If prevstat="go!" Then
Program.Delay(300)
GraphicsWindow.DrawText(200,200,"Stopping...")
Program.Delay(700)
GraphicsWindow.Clear()
EndIf
GraphicsWindow.Clear()
DrawGW()
EndIf
EndSub
Sub DrawGW
GraphicsWindow.Width=igw
GraphicsWindow.Height=igh
GraphicsWindow.BackgroundColor="Ivory"
GraphicsWindow.BrushColor = "DeepSkyBlue"
GraphicsWindow.FontSize=10
For q=1 To 7
butt[q] = Controls.AddButton(100,22,"("+q+")")
Controls.Move(butt[q],30,25+(q*50))
Controls.RegisterMouseUpEvent(butt[q],"illusion"+q)
GraphicsWindow.DrawBoundText(140,23+(q*50),350,illtext[q])
EndFor
GraphicsWindow.FontSize=20
GraphicsWindow.DrawText(170,10,"Optical Illusions")
GraphicsWindow.FontSize=15
GraphicsWindow.BrushColor="Orange"
GraphicsWindow.DrawText(30,440," !!--- Press [Esc] to return to this menu ---!! ")
EndSub