var theAnimation定为全局变量,在initCanvas()中加
function initCanvas(){
clearInterval(theAnimation);
clipping = {x:Math.random()*(redGame.width-2*radius)+radius,y:Math.random()*(redGame.height-2*radius)+radius,r:radius};
draw(images,clipping);
}
function initCanvas(){
clearInterval(theAnimation);
clipping = {x:Math.random()*(redGame.width-2*radius)+radius,y:Math.random()*(redGame.height-2*radius)+radius,r:radius};
draw(images,clipping);
}