draw()
function
which wipes the screen, draws the ball, then updates its current
position. We'll use a call to
setInterval(function, timeout)
in the init()
function to tell the browser to run our draw function every 10
milliseconds, creating the illusion of movement.
Try changing the dx and dy values to change the direction of the ball, or change the x and y variables to change where the ball will start. Make sure to try negative values for dx and dy.