0

我正在为 Android 浏览器构建 HTML5 游戏,经过一段时间后,画布突然无缘无故停止了动画?

function updateAnimation()
{
    context.clear = true; // makes the canvas clear itself on every frame           
    context.save();
    context.clearRect(0,0,ourGameCanvas.width,ourGameCanvas.height);
    context.drawImage(bg_img,0,0,ourGameCanvas.width,ourGameCanvas.height);     
    context.restore();
}

function startupTouchEvents()
{
    ourGameCanvas.addEventListener("touchstart", handleStart, false);
    ourGameCanvas.addEventListener("touchmove", handleMove, false);
}

function handleStart(evt)
{
    evt.preventDefault();       
    var touches = evt.changedTouches;
}

function handleMove(evt)
{
    evt.preventDefault();
}

当我多次触摸屏幕时,动画无缘无故地弯下腰!!!

任何想法 ?

4

0 回答 0