xxxxxxxxxx
function setup() {
createCanvas(windowWidth, windowHeight);
background(100);
}
function draw() {
createCanvas(windowWidth, windowHeight);
background(77, 165, 236, 150);
strokeWeight(10);
stroke(237, 186, 24, 255);
fill(233, 237, 24, 255)
ellipse(width / 2, height / 2, 3 * width / 5, 3 * width / 5);
/* //Becco
for(let r = width/4; r > -1 ; r = r - 10){
strokeWeight(4);
stroke(0, 200);
// ellipse(mouseX+r, mouseY+r, r, r);
//rosso 255, 0, 16
//azzurro 0, 255, 239
//giallo 255, 218, 20
fill(map(r, width/2, 0, 255, 251), map(r, width/2, 0, 0, 255), map(r, width/2, 0, 16, 20), 150);
ellipse(map(r, width/3, 0, width/2, mouseX), map(r, width/3, 0, height/2+150, mouseY), r, r);
//METTENDO IL RANGE DEL MAP DIVERSO DAL RANGE DELLA VARIABILE MI VIENE LA BASE DEL BECCO CHE SI MUOVE!!!!!
}
*/
strokeWeight(4);
stroke(0, 200);
//occhio sx
for (let s = width / 4; s > 0; s = s - 40) {
if (s < width / 16) {
fill(0, 200);
} else {
fill(255, 200);
}
ellipse(map(s, width / 3, 0, width / 3, 2 * mouseX / 3), map(s, width / 4, 0, height / 5, (height / 5) + 25),
map(s, width / 4, -1, 70, 50), map(s, width / 4, -1, 150, 70));
}
//occhio dx
for (let s = width / 4; s > 0; s = s - 40) {
if (s < width / 16) {
fill(0, 200);
} else {
fill(255, 200);
}
ellipse(map(s, width / 3, 0, 2 * width / 3, (width / 3) + (2 * mouseX / 3)), map(s, 3 * width / 4, 0, height / 5, (height / 5) + 25),
map(s, width / 4, -1, 70, 50), map(s, width / 4, -1, 150, 70));
}
//Becco
for (let r = width / 4; r > -1; r = r - 10) {
strokeWeight(4);
stroke(0, 200);
// ellipse(mouseX+r, mouseY+r, r, r);
//rosso 255, 0, 16
//azzurro 0, 255, 239
//giallo 255, 218, 20
fill(map(r, width / 2, 0, 255, 251), map(r, width / 2, 0, 0, 255), map(r, width / 2, 0, 16, 20), 150);
ellipse(map(r, width / 3, 0, width / 2, mouseX), map(r, width / 3, 0, height / 2 + 150, mouseY), r, r);
//METTENDO IL RANGE DEL MAP DIVERSO DAL RANGE DELLA VARIABILE MI VIENE LA BASE DEL BECCO CHE SI MUOVE!!!!!
}
}