Move that ball!!!
This task you will learn how to make a ball move. In order to do this we need to explore two things –
- Shapes
- keypress
Look at the code below –
ball = Shape.AddEllipse(20,20)
x = 200
y = 200
Shape.Move(ball, x, y)
GraphicsWindow.KeyDown = OnKeyDown
Sub OnKeyDown
If GraphicsWindow.LastKey = "Right" Then
x = x + 3
Shapes.Move(??????)
ElseIf GraphicsWindow.LastKey = "Left" Then
?????
Shapes.Move(?????)
EndIf
EndSub
This code is not complete and your job is to complete it! The ????? must be replaced and some more IF statements must be added. The goal is to have a ball which can be moved around the screen. To get help you may want to look at this site.

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











