Playing with physics and animation on a HTML5 canvas