var canvas = document.querySelector( 'canvas' );
var context = canvas.getContext( '2d' );
canvas.width = 200;
canvas.height = 200;
context.fillStyle = 'red';
context.fillRect( 100, 100, 10, 10 );
var canvas = document.querySelector( 'canvas' );
var context = canvas.getContext( '2d' );
canvas.width = 200;
canvas.height = 200;
context.fillStyle = 'red';
var x = 0;
setInterval( function() {
x = ++x % 200;
context.clearRect( 0, 0, 200, 200 );
context.fillRect( x, 100, 10, 10 );
}, 1000 / 60 );