為什么我只能畫出一條海葵?。?/h1>
aneObj.prototype.draw = function()
{
ctx2.save();
ctx2.globalAlpha = 0.6;
ctx2.strokeStyle = "#3b154e";
ctx2.lineWidth = 20;
ctx2.lineCap = "round";
ctx2.stroke();
for(var i =0 ;i<this.num;i++)
{
ctx2.beginPath();
ctx2.moveTo(this.x[i],canHeight);
ctx2.lineTo(this.x[i],canHeight - this.len[i]);
? }
ctx2.restore();
}
為什么我只能畫出一條????
aneObj.prototype.draw = function()
{
ctx2.save();
ctx2.globalAlpha = 0.6;
ctx2.strokeStyle = "#3b154e";
ctx2.lineWidth = 20;
ctx2.lineCap = "round";
ctx2.stroke();
for(var i =0 ;i<this.num;i++)
{
ctx2.beginPath();
ctx2.moveTo(this.x[i],canHeight);
ctx2.lineTo(this.x[i],canHeight - this.len[i]);
? }
ctx2.restore();
}
為什么我只能畫出一條????
2015-11-15
估計(jì)前面設(shè)置X坐標(biāo)時(shí)沒加上Math.random()*20之類的。