xxxxxxxxxx
65
// draws a stick figure guy inside a random color border, in a low frame rate.
let scribble = new Scribble();
function setup() {
createCanvas(450, 600);
let scribble = new Scribble();
frameRate(4);
}
function draw() {
background(255);
new Border();
stroke(0);
strokeWeight(5);
// face
scribble.scribbleEllipse(200, 150, 100, 100);
// eyes
scribble.scribbleEllipse(180, 140, 10, 10);
scribble.scribbleEllipse(220, 140, 10, 10);
// smile
scribble.scribbleCurve(180, 165, 220, 165, 190, 180, 210, 180);
// torso
scribble.scribbleLine(200, 200, 200, 330);
// legs
scribble.scribbleLine(200, 330, 150, 500);
scribble.scribbleLine(200, 330, 250, 500);
// arms
scribble.scribbleCurve(200, 220, 130, 310, 190, 210, 120, 300);
scribble.scribbleCurve(200, 220, 280, 220, 250, 280, 250, 280);
// waving hand
scribble.scribbleCurve(265, 200, 300, 200, 278, 225, 280, 220);
scribble.scribbleCurve(275, 187, 290, 190, 279, 223, 280, 220);
// speech
scribble.scribbleLine(280, 120, 280, 150);
scribble.scribbleLine(300, 120, 300, 150);
scribble.scribbleLine(280, 135, 300, 135);
scribble.scribbleLine(320, 120, 320, 150);
scribble.scribbleLine(345, 120, 340, 140);
scribble.scribbleEllipse(338, 150, 2, 2);
}
class Border {
constructor(){
let r = random(360);
colorMode(HSB);
// light color
noStroke();
fill(r, 5, 99);
rect(0, 0, 450, 600);
// hachures
strokeWeight(2);
stroke(r, 10, 90);
scribble.scribbleFilling([0, 0, 450, 450], [800, 0, 0, 800], random(2, 5), random(0, 360));
// white background
fill(255);
noStroke();
rect(75, 50, 300, 500);
// inside line
stroke(r, 10, 90);
strokeWeight(5);
scribble.scribbleRect(225, 300, 300, 500);
}
}