// to do .. breakable lel based on angular stress .. monkey import Pali_0.*; Tikk tikko; Cursive cursive; float groundy; void setup() { size(400,400); smooth(); framerate(30); //frame.setTitle("T i k k o"); groundy = height*0.85; tikko = new Tikk(width/2, groundy); tikko.maxIteration = 11; cursive = new Cursive(this); } void draw() { background(255); tikko.react(); tikko.update(0.75); tikko.contain(-100,-100,width+100,groundy,0.5); tikko.nail(width/2, groundy); if(keyPressed) tikko.root.arrange(); // Display stroke(128,200,0); noFill(); tikko.display(); stroke(45,60,0); //if(mousePressed) { strokeWeight(1); tikko.graph(this, 4); } noStroke(); fill(60,80,40); rect(0,groundy,width,height); /*strokeJoin(ROUND); for(int i=3; --i>=0;) { //stroke(Tbox.mixColor(color(100,200,255,128),color(60,120,255,64), i/3.0)); stroke(Tbox.mixColor(color(255,255,255,128),color(60,120,255), i/2.0)); strokeWeight(lerp(1.5,12, i/2.0)); cursive.text((int)framerate+" fps", 8, height-18, 20, lerp(0.0,0, i/2.0)); cursive.text(tikko.count()+" lel", 90, height-18, 20, lerp(0.0,0, i/2.0)); }*/ // Grow for(int i=2; --i>=0;) { if(tikko.bud.size()>0) { Lel selbud = (Lel)tikko.bud.elementAt((int)random(tikko.bud.size())); tikko.grow(selbud, tikko.count()<=1 ? 1 : 2); //tikko.grow(selbud, tikko.lel.size()<=1 ? 1 : (int)random(1,3)); } } }