a gameloop designed for the html5 canvas tag