xxxxxxxxxx
104
function setup() {
createCanvas(400, 400);
noStroke()
}
function mouseDragged(){
fill((254),(239),(14))
//tout ce qu'on ecrit comme instruction ici va s'executer seulement quand on va draguer la souris=clic et deplacement
ellipse(mouseX,mouseY,50,50)
}
function keyPressed(){
// elle s'exécute quand on appuie sur une touche
// si la touche appuyée est b
if(key == "b")
{//sourcil triangle
fill(0, 46, 238);
triangle(50, 75, 50, 20, 200, 75);
//yeux noir
noStroke();
fill(0, 0, 0);
ellipse(170, 170, 65, 65);
fill(255, 255, 255);
rect(160, 160, 15, 15);
fill (0, 0, 0);
ellipse (300, 170, 65, 65);
fill (255, 255, 255);
rect (292, 160, 15, 15);
//pois blancs
ellipse(random(width), random(height), 30, 30);
//bouche framboise
fill(233, 14, 57);
arc(235, 300, 100, 100, PI, TWO_PI);
}
if(key == "c")
{ //fond
background (251, 2, 2);
//pois noirs
ellipse(random(width), random(height), 30, 30);
//bouche mauve
fill (206, 158, 255);
ellipse (235, 300, 100, 100);
//yeux bleu
noStroke();
fill(98, 244, 243);
ellipse(170, 170, 65, 65);
fill(0, 0, 0);
rect(160, 160, 15, 15);
fill (98, 244, 243);
ellipse (300, 170, 65, 65);
fill (0, 0, 0);
rect (292, 160, 15, 15);
}
if (key == "d")
{ background (250, 236, 214);
}
if (key == "e")
{ background (0, 0, 0);
fill (250, 236, 214);
rect(random(width), random(height), 100, 100);
}
if (key == "f")
{
background (236, 15, 15);
}
if (key == "g")
{background (236, 136, 15);
}
{if (key == "h")
background (255, 226, 0);
}
{if (key == "i")
background (10, 38, 190);
}
if(key == "j")
{//sourcil grand triangle
fill(0, 46, 238);
triangle(150, 575, 550, 120, 200, 15);
//yeux noir
noStroke();
fill(0, 150, 0);
ellipse(170, 170, 65, 65);
fill(255, 255, 255);
rect(160, 160, 15, 15);
fill (0, 0, 0);
ellipse (300, 170, 65, 65);
fill (255, 255, 255);
rect (292, 160, 15, 15);
//pois blancs
ellipse(random(width), random(height), 30, 30);
//bouche framboise
fill(233, 14, 57);
arc(235, 300, 100, 100, PI, TWO_PI);
}
}
function draw() {
}