Will it bounce?
Consider the code below –
x = 200 y = 200 hspeed = 2 vspeed = 2 ball = Shape.AddEllipse(x,y) loop = 1 while loop = 1 x = x + hspeed y = y + vspeed Shape.Move(ball, x, y) ?????? endwhile
Your task is to add some code which will make the ball bounce off the side of the screen. You will need to consider –
- using if statements
- using GraphicsWindow.width and GraphicsWindow.height
- change hspeed and vspeed to be negative or positive depending on the direction
- when you multiply a number by -1 it will swap from positive to negative and visa versa.

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











