function Test() { intervalT = setInterval(BulletExplosionAnimate, 80); } var bulletExplosionStart = 0; function BulletExplosionAnimate(intervalT) { var wide = 70; var high = 70; if (bulletExplosionStart > 308) { clearInterval(intervalT); } else { ctxExplosion.clearRect(0,0,canvasWidth,canvasHeight) ctxExplosion.drawImage(spriteImage,bulletExplosionStart,1250,wide,high,100,100,wide,high); bulletExplosionStart += 77; } }