Bouncing Animation

A square moves across the canvas and bounces off the walls using collision detection and requestAnimationFrame. Click the canvas to give it a new random color.