jsfiddle:http: //jsfiddle.net/Z2YSt/173/
编码 :
function createShipMissil(x, y, imgw, imgh) {
MissileCtx.save();
MissileCtx.clearRect(0, 0, imgw, imgh);
MissileCtx.fillStyle = "rgba(0,200,0,1)";
MissileCtx.fillRect(x, y, imgw, imgh);
MissileCtx.restore();
y -= 1;
setTimeout(function () { createShipMissil(x, y, imgw, imgh); }, 30);
}
我的问题是,当画线时,它看起来是连续的。我怎样才能改变它,让它看起来像一个移动的矩形?