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){
Score++;
document.querySelector(".winNum").innerHTML=winNum;
}
})
},1000)
教程地址