let sizew = window.innerWidth;let sizeh = window.innerHeight;let numdays = (Date.now()/1000 - minttime)/550;var grassColour,grass=[],grassLength=numdays/2e3<=15?numdays/2e3:15;grassLength<1&&(grasslength=1);let daycount=0,palettes=[["rgb(139, 191, 0)","rgb(168, 227, 20)","rgb(168, 227, 20)","rgb(51, 66, 12)"],["rgb(245,185,224)","rgb(226,129,207)","rgb(226,129,207)","rgb(78,17,53)"],["rgb(161,122,65)","rgb(231,216,211)","rgb(138,91,35)","rgb(68,29,15)"],["rgb(242,239,222)","rgb(126,137,61)","rgb(56,72,25)","rgb(65,59,47)"],["rgb(139, 191, 0)","rgb(168, 227, 20)","rgb(168, 227, 20)","rgb(51, 66, 12)"],["#6FA09B","rgb(29,204,144)","rgb(36,68,49)","rgb(5,40,28)"]],trunks=["rgb(20,20,20)","rgb(40,40,40)","rgb(50,40,40)","rgb(114,114,114)","rgb(37,20,12)"],grasses=["rgb(24,54,23)","rgb(37,90,25)","rgb(93,75,54)","rgb(40,65,4)"];function setup(){createCanvas(sizew,sizeh),randomSeed(mintseed),angleMode(RADIANS),grassColour=color(grasses[grassChoice]);for(var r=0;r<=20;r+=1)grass.push(new Grass(createVector(width/2,height)))}function draw(){let r=angle1;background(10,10,10);let t=[sizew/2,sizeh],s=randomBetween(70,120),e=randomBetween(15,45),n=PI/r,a=new Branch(t,e,s,n,0);strokeWeight(e),stroke(30),branch(a),noLoop(),stroke(grassColour,random(50,200));for(var _=0;_16?stroke(palettes[paletteChoice][0]):a>13?stroke(palettes[paletteChoice][1]):a>12?stroke(palettes[paletteChoice][2]):a>7?stroke(palettes[paletteChoice][3]):stroke(trunks[trunkChoice]),line(t[0],t[1],g[0],g[1]);let b=n+PI/4,h=n-PI/4,o=randomBetween(0,b-h-PI/16),l=randomBetween(.5*s,.8*s),i=randomBetween(.7*e,.9*e);if(i<3||daycount>=numdays)return;daycount++;let c=new Branch(g,l,i,b-o/2,a+1),u=new Branch(g,l,i,h+o/2,a+1);branch(c),branch(u)}class Branch{constructor(r,t,s,e,n){this.startPoint=r,this.weight=t,this.length=s,this.angle=e,this.parentCount=n}}function randomBetween(r,t){return random(t-r)+r}function Grass(r){this.blades=[],this.am=int(random(1,5)),this.loc=r,this.loc.x=this.loc.x+random(-30,30);for(var t=0;t5&&(rotate(radians(this.angle+sin(r+0))),this.branch(r)),pop()}}