xxxxxxxxxx
70
let angle = 5;
let b = angle;
let direction = false;
function setup() {
createCanvas(600, 400);
}
function draw() {
background(100, 150, 180);
birdman ();
function birdman() {
push();
noStroke();
fill (20);
//torso
rect (250, 200, 50, 100);
//left arm
push();
b+= .1
translate (250, 210);
rotate (30+ b);
rect (0, 0, 20, 90);
//wave down
if (b >= 100) {
direction = true;
} else {
direction = false;
}
if (direction = true) {
b *= 1
}
if (direction = false) {
b *= -1
}
pop();
//right arm
rect (305, 210, 20, 90);
//left leg
rect (250, 300, 20, 90);
//right leg
rect (280, 300, 20, 90);
//head
ellipse (275, 160, 90, 60);
//negative space
noStroke();
fill(100, 150, 180);
ellipse (275, 160, 60, 40);
//beak
noStroke();
fill (20);
triangle(240, 170, 210, 155, 240, 145);
//eyeball
noStroke();
fill(255);
ellipse (275, 160, 40, 30);
//pupil
noStroke();
fill(20);
ellipse (275, 160, 20, 25);
pop();
}
}
//https://editor.p5js.org/p5/sketches/Data:_True_and_False