最新回答 / 慕仔8415870
halo.JShaloObj.prototype.born=function(x,y){ for(var i=0;i<this.num;i++) { if(!this.alive[i]) { this.x[i]=x; this.y[i]=y; this.r[i]=10; this.alive[i]=true; } }}代碼遺落了一個? ? ? ? “ !”字符if(!this.alive[i])? ? ? ? ? ?加上就好了“ !”字符
2016-07-02
想知道我這段代碼錯在哪里
ctx1.drawImage(momTailCount[momTailCount],-momTailCount[momTailCount].width*0.5+30,-momTailCount[momTailCount].height*0.5);
下面是瀏覽器報錯:
?mom.js:47 Uncaught TypeError: Cannot read property 'width' of undefined
ctx1.drawImage(momTailCount[momTailCount],-momTailCount[momTailCount].width*0.5+30,-momTailCount[momTailCount].height*0.5);
下面是瀏覽器報錯:
?mom.js:47 Uncaught TypeError: Cannot read property 'width' of undefined
2016-07-02
最新回答 / 薄荷味的白襯衫
beginPath();ctx2.moveTo(this.rootx[i],canHeight);this.headx[i] = this.rootx[i] + l * this.amp[i];ctx2.quadraticCurveTo(this.rootx[i],canHeight - 120,this.headx[i],this.heady[i]);
2016-06-28
1.這里的31行 break 換成 continue 比較好。
2.break 之所以沒出現bug,是因為循環是順循環,如果逆循環一下就出現bug了。
3.當第一個圈剛好消失時候的同時吃了一個新的果實就會出現bug,不過實際測試出現這種情況概率太小,所以沒法復現。用2可以看出bug。
2.break 之所以沒出現bug,是因為循環是順循環,如果逆循環一下就出現bug了。
3.當第一個圈剛好消失時候的同時吃了一個新的果實就會出現bug,不過實際測試出現這種情況概率太小,所以沒法復現。用2可以看出bug。
2016-06-28
最新回答 / 楊凱迪
?if (this.r[i] > 60) {? ? ? ? ? ? ? ? this.alive[i] = false;? ? ? ? ? ? ? ? continue;? ? ? ? ? ? }?continue;改成break;
2016-06-26