simple animation
Below is some code to create a simple animation. Your task is to add 2 more clouds to the screen which move independently of the original cloud. They should all start at different positions on the screen, but they may sometimes overlap.
The video below will explain the code for you.
'setting the colour
GraphicsWindow.BackgroundColor = "blue"
GraphicsWindow.BrushColor = "white"
GraphicsWindow.PenColor = "white"
' adding shapes to the screen (allows them to be moved)
cloud = Shapes.AddEllipse(150,70)
' inital position of the cloud
x = 100
y = 120
' keep looping forever!
While "true"
' move the cloud
Shapes.Move(cloud, x,y)
' if the cloud is off the screen
If x > GraphicsWindow.Width + 150 Then
' place it on the left hand side at a random position vertically
x = -150
y = Math.GetRandomNumber(300)
EndIf
' move the cloud to the right
x = x + 1
' wait 10 mili seconds.
Program.Delay(10)
EndWhile

You need to log in or create an account to submit code!











