Sub AddBubbles
nBubbles = 10
GraphicsWindow.PenColor = "White"
GraphicsWindow.BrushColor = "White"
For i = 1 To nBubbles
oBubbles[i] = Shapes.AddEllipse(5, 5)
xBubbles[i] = x + 60 + Math.GetRandomNumber(50)
yBubbles[i] = y + height - 25 - Math.GetRandomNumber(depth - 25)
EndFor
EndSub
Sub MoveBubbles
up = 40
For i = 1 To nBubbles
yBubbles[i] = yBubbles[i] - up
If yBubbles[i] < y + height - depth Then
xBubbles[i] = x + 60 + Math.GetRandomNumber(50)
yBubbles[i] = y + height - 25 - Math.GetRandomNumber(up)
EndIf
Shapes.Move(oBubbles[i], xBubbles[i], yBubbles[i])
EndFor
EndSub
Sub AddBall
Stack.PushValue("local", x)
Stack.PushValue("local", y)
GraphicsWindow.PenColor = "DarkGray"
GraphicsWindow.BrushColor = "DarkGray"
oAquarium = Shapes.AddEllipse(50, 50)
x = x + 60
y = y + height - 50
Shapes.Move(oAquarium, x, y)
Shapes.SetOpacity(oAquarium, 50)
y = Stack.PopValue("local")
x = Stack.PopValue("local")
EndSub
Sub AddWater
Stack.PushValue("local", y)
y = y + height - depth
GraphicsWindow.PenColor = "White"
GraphicsWindow.BrushColor = "Aqua"
oAquarium = Shapes.AddRectangle(width, depth)
Shapes.Move(oAquarium, x, y)
Shapes.SetOpacity(oAquarium, 10)
y = Stack.PopValue("local")
EndSub
Sub StartTimer
Timer.Interval = 200
Timer.Tick = OnTick
EndSub