亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

圓圈沒有漸變消失,而是變大后直接消失

var?waveObj?=?function()?{
????this.x?=?[];
????this.y?=?[];
????this.alive?=?[];
????this.r?=?[];
}
waveObj.prototype.num?=?10;
waveObj.prototype.init?=?function(){
????for(var?i=0;i<this.num;i++){
????????this.alive[i]?=?false;
????????this.r[i]?=?0;
????}
}
waveObj.prototype.draw?=?function(){
????ctx1.save();
????ctx1.lineWidth?=?2;
????ctx1.shadowBlur?=?10;
????ctx1.shadowColor?=?"white";
????for(var?i=0;i<this.num;i++){
????????if(this.alive[i]){
????????????this.r[i]?+=?deltaTime?*?0.05;
????????????if(this.r[i]?>?60)?this.alive[i]?=?false;
????????????var?alpha?=?1?-?this.r[i]?/?60;
????????????ctx1.beginPath();
????????????ctx1.arc(this.x[i],this.y[i],this.r[i],0,Math.PI?*?2);
????????????ctx1.closePath();
????????????ctx1.strokeStyle?=?"rgba(255,255,255"+?alpha?+")";
????????????ctx1.stroke();

????????}
????}
????ctx1.restore();
}
waveObj.prototype.born?=?function(x,y){
????//console.log("born");
????for(var?i=0;i<this.num;i++){
????????if(!this.alive[i]){
????????????this.alive[i]?=?true;
????????????this.r[i]?=?10;
????????????this.x[i]?=?x;
????????????this.y[i]?=?y;
????????????return;
????????}
????}
}


正在回答

1 回答

if(this.r[i]?>?60){
?this.alive[i]?=?false;
?break;
?}


0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

圓圈沒有漸變消失,而是變大后直接消失

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號