To create a linear motion animation with HTML5 Canvas, we can increment the x, y, or both the x and y position of an object for each frame according to the equation of velocity:
distance = velocity * time
Code Editor
Modified on April 9th, 2013
by Eric Rowell