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);
}
내 문제는 라인을 그릴 때, 그것은 연속 보이는 것입니다. 사각형을 움직이는 것처럼 보이게하려면 어떻게 바꿀 수 있습니까?
거기에 조금 더 빨리 갈 수있는 방법이 있습니까? – Sora
@Sora, 여기를 더 빨리 만드는 또 다른 방법이 있습니다 : http://jsfiddle.net/hfDhA/ – Sergio