Puoi ruotare i due rettangoli tramite la tastiera e/o il mouse

Premi il tasto INVIO e farai ruotare il rettangolo rosso

Premi il tasto SPAZIO, la barra spaziatrice, e farai ruotare il rettangolo blu

Premi i tasti INVIO e SPAZIO per ruotarli entrambi

Posiziona il puntatore del mouse su uno dei due rettangoli e con il clic di uno dei tasti lo farai ruotare
GraphicsWindow.BackgroundColor="Black"
ww=200
hh=100
distanza=25
ww2=ww/2
hh2=hh/2
x1=GraphicsWindow.Width/2-ww-distanza
y1=GraphicsWindow.Height/2-hh2-distanza
x2=x1+ww
y2=y1+hh
x3=GraphicsWindow.Width/2+distanza
y3=GraphicsWindow.Height/2-hh2-distanza
x4=GraphicsWindow.Width/2+ww
y4=GraphicsWindow.Height/2+hh2
GraphicsWindow.BrushColor="Red"
forma1=Shapes.AddRectangle(ww, hh)
Shapes.Move(forma1,x1,y1)
GraphicsWindow.BrushColor="Blue"
forma2=Shapes.AddRectangle(ww, hh)
Shapes.Move(forma2,x3,y3)
GraphicsWindow.KeyDown =tastoGiu
GraphicsWindow.KeyUp =tastoSu
GraphicsWindow.MouseDown=mouseGiu
GraphicsWindow.MouseUp =mouseSu
Sub tastoGiu
If(GraphicsWindow.LastKey = "Return") then
Shapes.Rotate(forma1, 90)
ElseIf(GraphicsWindow.LastKey = "Space") Then
Shapes.Rotate(forma2, 90)
EndIf
EndSub
Sub tastoSu
If(GraphicsWindow.LastKey = "Return") then
Shapes.Rotate(forma1, 0)
ElseIf(GraphicsWindow.LastKey = "Space") Then
Shapes.Rotate(forma2, 0)
EndIf
EndSub
Sub mouseGiu
x=GraphicsWindow.MouseX
y=GraphicsWindow.MouseY
If(x >= x1) And (x <= x2) And (y >= y1) And (y <= y2) Then
Shapes.Rotate(forma1, 90)
ElseIf(x >= x3) And (x <= x4) And (y >= y3) And (y <= y4) Then
Shapes.Rotate(forma2, 90)
EndIf
EndSub
Sub mouseSu
x=GraphicsWindow.MouseX
y=GraphicsWindow.MouseY
If(x >= x1) And (x <= x2) And (y >= y1) And (y <= y2) Then
Shapes.Rotate(forma1, 0)
ElseIf(x >= x3) And (x <= x4) And (y >= y3) And (y <= y4) Then
Shapes.Rotate(forma2, 0)
EndIf
EndSub