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)
标签:Tween,exportRoot,用法,tween,createjs,Coin,Math
From: https://www.cnblogs.com/guangzhiruijie/p/18370970