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)