var?ss=new?Array();
for(var?p=0;p<50;p++){
????var?r=Math.random()*10+10;
????var?x=Math.random()*can.width;
????var?y=Math.random()*can.height;
????var?rott=Math.random()*360;
????ss.push([r,x,y]);
????if?(Math.sqrt(Math.pow(ss[0][1]-x,2)+Math.pow(ss[0][2]-y,2))>ss[0][0]+r){
????????kk(tex,r,r/2,x,y,rott);
????}
}
function?kk(tex,R,r,x,y,rot)?{
????tex.lineWidth=10;
????tex.beginPath();
????for(var?i=0;i<5;i++){
????????tex.lineTo(Math.cos((18+i*72-rot)/180*Math.PI)*R+x,-Math.sin((18+i*72-rot)/180*Math.PI)*R+y);
????????tex.lineTo(Math.cos((54+i*72-rot)/180*Math.PI)*r+x,-Math.sin((54+i*72-rot)/180*Math.PI)*r+y);
????}
????tex.closePath();
????tex.fillStyle='#fb3';
????tex.strokeStyle='#fb5';
????tex.lineWidth=10;
????tex.lineJoin='round';
????tex.fill();
????tex.stroke();
}
2018-07-03
這樣不行吧??