Skip to content

Instantly share code, notes, and snippets.

@neerfix
Created June 16, 2022 20:30
Show Gist options
  • Save neerfix/a808296665335cdc2e57b147cbe24dd7 to your computer and use it in GitHub Desktop.
Save neerfix/a808296665335cdc2e57b147cbe24dd7 to your computer and use it in GitHub Desktop.
let value = 0;
let perroquet = 'P E R R O Q U E T';
function setup() {
createCanvas(600, 600);
angleMode(DEGREES);
}
function mouseClicked() {
switch (value) {
// Bresil
case 0:
value = 1;
break;
// Delhi
case 1:
value = 2;
break;
// Abidjan
case 2:
value = 3;
break;
// Tokyo
case 3:
value = 4;
break;
// Pekin
case 4:
value = 0;
break;
}
}
// bloc de carré
function draw() {
switch (value) {
// Bresil
case 0:
fill(0, 0, 125);
square(0, 0, 600);
fill(34,134,124);
square(80, 80, 430);
//perroquet
stroke(255);
textSize(35);
noFill();
textStyle(BOLD);
text(perroquet, 100, 105, 50, 500); // Text wraps within text box
//Titre
noStroke();
textSize(28);
textStyle(BOLD);
fill(237,129,20);
textStyle(NORMAL);
text('Oiseaux Exotiques',80,60);
//sous-titre
noStroke();
textSize(20);
fill(237,129,20);
textStyle(NORMAL);
text('Plus près de la nature',315,540);
//Brésil
noStroke();
textSize(25);
textStyle(BOLD);
fill(237,129,20);
textStyle(NORMAL);
text('BRESIL',315,570);
//Airfrance
noStroke();
textSize(18);
textStyle(BOLD);
fill(237,129,20);
textStyle(NORMAL);
text('Airfrance.com',80,570);
fill(236, 115, 75); //aile gauche
arc(225,280, 120, 120, 315, 135, OPEN);//aile gauche
fill(2, 1, 41); //bec-nose-haut
arc(355,200, 50, 50,180, 0, OPEN);//aile droite
// arc(X, Y, W, H, 0, STOP);
fill(2, 1, 41); //bec-nose-bas
arc(355,200, 50, 50,30,210, OPEN);//bas
// arc(X, Y, W, H, 0, STOP);
// dessin Perroquet
fill(255, 191, 124); //corps
arc(255,300, 200, 200, 270,90, OPEN);
// arc(X, Y, W, H, 0, STOP);
fill(247, 151, 83); //tête
circle(300, 200, 100);
//bandes oranges
rect(0, 210, 20, 300, 0, 100, 0, 100);
rect(580, 80, 20, 300, 100, 0, 100, 0);
fill(236, 115, 75); //plume3
arc(330,135, 50, 50,300,120, OPEN);//3
// arc(X, Y, W, H, 0, STOP);
fill(243, 208, 90); //plume2
arc(310,135, 50, 50,300,120, OPEN);//bas
// arc(X, Y, W, H, 0, STOP);
fill(236, 115, 75); //plume1
arc(290,135, 50, 50,300,120, OPEN);//3
// arc(X, Y, W, H, 0, STOP);
//oeil
fill(236,115,75); //paupiere
circle(310, 195, 30);
fill(250); //oeil
circle(310, 200, 30);
fill(0,0,125); //pupille
circle(317,199,10);
fill(243, 208, 90); //queue de pie
arc(220,350, 170, 170,315, 125, OPEN);//queue de pie
// arc(X, Y, W, H, 0, STOP);
fill(247, 151, 83); //aile droite
arc(240,330, 120, 120,315, 135, OPEN);//aile droite
// arc(X, Y, W, H, 0, STOP);
break;
// Delhi
case 1:
fill(0, 0, 125);
square(0, 0, 600);
fill(34,134,124);
square(80, 80, 430);
//perroquet
stroke(255);
textSize(35);
noFill();
textStyle(BOLD);
text(perroquet, 100, 105, 50, 500); // Text wraps within text box
//Titre
noStroke();
textSize(28);
textStyle(BOLD);
fill(237,129,20);
textStyle(NORMAL);
text('Oiseaux Exotiques',80,60);
//sous-titre
noStroke();
textSize(20);
fill(237,129,20);
textStyle(NORMAL);
text('Plus près de la nature',315,540);
//Delhi
noStroke();
textSize(25);
textStyle(BOLD);
fill(237,129,20);
textStyle(NORMAL);
text('DELHI',315,570);
//Airfrance
noStroke();
textSize(18);
textStyle(BOLD);
fill(237,129,20);
textStyle(NORMAL);
text('Airfrance.com',80,570);
fill(236, 115, 75); //aile gauche
arc(225,280, 120, 120, 315, 135, OPEN);//aile gauche
fill(2, 1, 41); //bec-nose-haut
arc(355,200, 50, 50,180, 0, OPEN);//aile droite
// arc(X, Y, W, H, 0, STOP);
fill(2, 1, 41); //bec-nose-bas
arc(355,200, 50, 50,30,210, OPEN);//bas
// arc(X, Y, W, H, 0, STOP);
// dessin Perroquet
fill(255, 191, 124); //corps
arc(255,300, 200, 200, 270,90, OPEN);
// arc(X, Y, W, H, 0, STOP);
fill(247, 151, 83); //tête
circle(300, 200, 100);
//bandes oranges
rect(0, 210, 20, 300, 0, 100, 0, 100);
rect(580, 80, 20, 300, 100, 0, 100, 0);
fill(236, 115, 75); //plume3
arc(330,135, 50, 50,300,120, OPEN);//3
// arc(X, Y, W, H, 0, STOP);
fill(243, 208, 90); //plume2
arc(310,135, 50, 50,300,120, OPEN);//bas
// arc(X, Y, W, H, 0, STOP);
fill(236, 115, 75); //plume1
arc(290,135, 50, 50,300,120, OPEN);//3
// arc(X, Y, W, H, 0, STOP);
//oeil
fill(236,115,75); //paupiere
circle(310, 195, 30);
fill(250); //oeil
circle(310, 200, 30);
fill(0,0,125); //pupille
circle(317,199,10);
fill(243, 208, 90); //queue de pie
arc(220,350, 170, 170,315, 125, OPEN);//queue de pie
// arc(X, Y, W, H, 0, STOP);
fill(247, 151, 83); //aile droite
arc(240,330, 120, 120,315, 135, OPEN);//aile droite
// arc(X, Y, W, H, 0, STOP);
break;
// Abidjan
case 2:
fill(0, 0, 125);
square(0, 0, 600);
fill(34,134,124);
square(80, 80, 430);
//perroquet
stroke(255);
textSize(35);
noFill();
textStyle(BOLD);
text(perroquet, 100, 105, 50, 500); // Text wraps within text box
//Titre
noStroke();
textSize(28);
textStyle(BOLD);
fill(237,129,20);
textStyle(NORMAL);
text('Oiseaux Exotiques',80,60);
//sous-titre
noStroke();
textSize(20);
fill(237,129,20);
textStyle(NORMAL);
text('Plus près de la nature',315,540);
//Brésil
noStroke();
textSize(25);
textStyle(BOLD);
fill(237,129,20);
textStyle(NORMAL);
text('BRESIL',315,570);
//Airfrance
noStroke();
textSize(18);
textStyle(BOLD);
fill(237,129,20);
textStyle(NORMAL);
text('Airfrance.com',80,570);
fill(236, 115, 75); //aile gauche
arc(225,280, 120, 120, 315, 135, OPEN);//aile gauche
fill(2, 1, 41); //bec-nose-haut
arc(355,200, 50, 50,180, 0, OPEN);//aile droite
// arc(X, Y, W, H, 0, STOP);
fill(2, 1, 41); //bec-nose-bas
arc(355,200, 50, 50,30,210, OPEN);//bas
// arc(X, Y, W, H, 0, STOP);
// dessin Perroquet
fill(255, 191, 124); //corps
arc(255,300, 200, 200, 270,90, OPEN);
// arc(X, Y, W, H, 0, STOP);
fill(247, 151, 83); //tête
circle(300, 200, 100);
//bandes oranges
rect(0, 210, 20, 300, 0, 100, 0, 100);
rect(580, 80, 20, 300, 100, 0, 100, 0);
fill(236, 115, 75); //plume3
arc(330,135, 50, 50,300,120, OPEN);//3
// arc(X, Y, W, H, 0, STOP);
fill(243, 208, 90); //plume2
arc(310,135, 50, 50,300,120, OPEN);//bas
// arc(X, Y, W, H, 0, STOP);
fill(236, 115, 75); //plume1
arc(290,135, 50, 50,300,120, OPEN);//3
// arc(X, Y, W, H, 0, STOP);
//oeil
fill(236,115,75); //paupiere
circle(310, 195, 30);
fill(250); //oeil
circle(310, 200, 30);
fill(0,0,125); //pupille
circle(317,199,10);
fill(243, 208, 90); //queue de pie
arc(220,350, 170, 170,315, 125, OPEN);//queue de pie
// arc(X, Y, W, H, 0, STOP);
fill(247, 151, 83); //aile droite
arc(240,330, 120, 120,315, 135, OPEN);//aile droite
// arc(X, Y, W, H, 0, STOP);
break;
// Tokyo
case 3:
fill(0, 0, 125);
square(0, 0, 600);
fill(34,134,124);
square(80, 80, 430);
//perroquet
stroke(255);
textSize(35);
noFill();
textStyle(BOLD);
text(perroquet, 100, 105, 50, 500); // Text wraps within text box
//Titre
noStroke();
textSize(28);
textStyle(BOLD);
fill(237,129,20);
textStyle(NORMAL);
text('Oiseaux Exotiques',80,60);
//sous-titre
noStroke();
textSize(20);
fill(237,129,20);
textStyle(NORMAL);
text('Plus près de la nature',315,540);
//Brésil
noStroke();
textSize(25);
textStyle(BOLD);
fill(237,129,20);
textStyle(NORMAL);
text('BRESIL',315,570);
//Airfrance
noStroke();
textSize(18);
textStyle(BOLD);
fill(237,129,20);
textStyle(NORMAL);
text('Airfrance.com',80,570);
fill(236, 115, 75); //aile gauche
arc(225,280, 120, 120, 315, 135, OPEN);//aile gauche
fill(2, 1, 41); //bec-nose-haut
arc(355,200, 50, 50,180, 0, OPEN);//aile droite
// arc(X, Y, W, H, 0, STOP);
fill(2, 1, 41); //bec-nose-bas
arc(355,200, 50, 50,30,210, OPEN);//bas
// arc(X, Y, W, H, 0, STOP);
// dessin Perroquet
fill(255, 191, 124); //corps
arc(255,300, 200, 200, 270,90, OPEN);
// arc(X, Y, W, H, 0, STOP);
fill(247, 151, 83); //tête
circle(300, 200, 100);
//bandes oranges
rect(0, 210, 20, 300, 0, 100, 0, 100);
rect(580, 80, 20, 300, 100, 0, 100, 0);
fill(236, 115, 75); //plume3
arc(330,135, 50, 50,300,120, OPEN);//3
// arc(X, Y, W, H, 0, STOP);
fill(243, 208, 90); //plume2
arc(310,135, 50, 50,300,120, OPEN);//bas
// arc(X, Y, W, H, 0, STOP);
fill(236, 115, 75); //plume1
arc(290,135, 50, 50,300,120, OPEN);//3
// arc(X, Y, W, H, 0, STOP);
//oeil
fill(236,115,75); //paupiere
circle(310, 195, 30);
fill(250); //oeil
circle(310, 200, 30);
fill(0,0,125); //pupille
circle(317,199,10);
fill(243, 208, 90); //queue de pie
arc(220,350, 170, 170,315, 125, OPEN);//queue de pie
// arc(X, Y, W, H, 0, STOP);
fill(247, 151, 83); //aile droite
arc(240,330, 120, 120,315, 135, OPEN);//aile droite
// arc(X, Y, W, H, 0, STOP);
break;
// Pekin
case 4:
fill(0, 0, 125);
square(0, 0, 600);
fill(34,134,124);
square(80, 80, 430);
//perroquet
stroke(255);
textSize(35);
noFill();
textStyle(BOLD);
let s = 'P E R R O Q U E T';
text(s, 100, 105, 50, 500); // Text wraps within text box
//Titre
noStroke();
textSize(28);
textStyle(BOLD);
fill(237,129,20);
textStyle(NORMAL);
text('Oiseaux Exotiques',80,60);
//sous-titre
noStroke();
textSize(20);
fill(237,129,20);
textStyle(NORMAL);
text('Plus près de la nature',315,540);
//Brésil
noStroke();
textSize(25);
textStyle(BOLD);
fill(237,129,20);
textStyle(NORMAL);
text('BRESIL',315,570);
//Airfrance
noStroke();
textSize(18);
textStyle(BOLD);
fill(237,129,20);
textStyle(NORMAL);
text('Airfrance.com',80,570);
fill(236, 115, 75); //aile gauche
arc(225,280, 120, 120, 315, 135, OPEN);//aile gauche
fill(2, 1, 41); //bec-nose-haut
arc(355,200, 50, 50,180, 0, OPEN);//aile droite
// arc(X, Y, W, H, 0, STOP);
fill(2, 1, 41); //bec-nose-bas
arc(355,200, 50, 50,30,210, OPEN);//bas
// arc(X, Y, W, H, 0, STOP);
// dessin Perroquet
fill(255, 191, 124); //corps
arc(255,300, 200, 200, 270,90, OPEN);
// arc(X, Y, W, H, 0, STOP);
fill(247, 151, 83); //tête
circle(300, 200, 100);
//bandes oranges
rect(0, 210, 20, 300, 0, 100, 0, 100);
rect(580, 80, 20, 300, 100, 0, 100, 0);
fill(236, 115, 75); //plume3
arc(330,135, 50, 50,300,120, OPEN);//3
// arc(X, Y, W, H, 0, STOP);
fill(243, 208, 90); //plume2
arc(310,135, 50, 50,300,120, OPEN);//bas
// arc(X, Y, W, H, 0, STOP);
fill(236, 115, 75); //plume1
arc(290,135, 50, 50,300,120, OPEN);//3
// arc(X, Y, W, H, 0, STOP);
//oeil
fill(236,115,75); //paupiere
circle(310, 195, 30);
fill(250); //oeil
circle(310, 200, 30);
fill(0,0,125); //pupille
circle(317,199,10);
fill(243, 208, 90); //queue de pie
arc(220,350, 170, 170,315, 125, OPEN);//queue de pie
// arc(X, Y, W, H, 0, STOP);
fill(247, 151, 83); //aile droite
arc(240,330, 120, 120,315, 135, OPEN);//aile droite
// arc(X, Y, W, H, 0, STOP);
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment