UPDATED: HTML5 bouncing ball example

This new version of the example features better comments explaining each line of code.

It also includes the changes we made in class today to create a variable (radius or r) that holds the ball's radius and is used to make the ball bounce before any of its edges goes off any side of the canvas. (notice in the previous example that the ball doesn't bounce until its center reaches an edge)

Comments