Creating animations with the Canvas API