createjs tween用法

setInterval(()=>{
Let Coin =new lib.Coin();
Coin.x=Math.floor(Math.random()*(600-30+1))+30);
Coin.y=-50;
exportRoot.addChildAt(Coin,1);
createjs.Tween.get(Coin)
    .to({y:400},2500)
    .call(()=>{
    exportRoot.removeChild(Coin);
    })
.addEventListener("change",()=>{
        let hit=ndgmr.checkRectCollision();
        if(hit){
            createjs.Tween.removeTween();
            exportRoot.removeChild(Coin);
            Score++;
            document.querySelector(".winNum").innerHTML=winNum;
        }
    })
},1000)

教程地址

posted @ 2024-08-21 09:40  多见多闻  阅读(2)  评论(0编辑  收藏  举报