/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://studio.sketchpad.cc/sp/pad/view/ro.MpAopqaPsNb/rev.1067
*
* authors:
* caleb mascarenhas
* Jacqueline Cobiak
* Marcos Aurelio
*
* Rafael Simoneli Nunes Gregório
* Samuel Henrique Oliveira da Silva
* marcos aurelio da silva
* Vera Lucia Salles
* John Bertoldo da Silva
*
*
*
* Alex Sandro Duarte de Santana
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
int cor3=0;
int cor2=0;
int cor=0;
float x, y, t, movOlhoX, movOlhoY,velOlhoX,velOlhoY;
float distancia;
float xJac;
float YJac;
float posxJac1=260;
float posxJac2=125;
float posYJac1=130;
float posYJac2=130;
void setup(){
size (800,500);
smooth();
x=width/2+width/4;
y=height/2-height/4;
t=20;
velOlhoX = 4.8;
velOlhoY =2.5;
}
void draw(){
background(0);
//frameRate(random(5,25));
pintaOlho();
moveOlho();
veraS();
jac();
john();
}
// COLOQUE O SEU SKETCH AQUI
//Samuel-Começo
void desenhoSamuel(){
if(cor>=255){
cor=255;
cor2++;
}
if(cor2>=255){
cor3++;
cor=255;
cor2=255;
}
strokeWeight(5);
fill(190);
rect(10, 10, 100, 220);
strokeWeight(1.95);
fill(0, cor3, 0);
ellipse(59, 190, 50, 50);//Amarelo
fill(cor2, cor2, 0);
ellipse(59, 120, 50, 50);//Verde
fill(cor, 0, 0);
ellipse(59, 50, 50, 50);//Vermelho
cor++;
//Samuel -Fim
}
void desenhoMarcos(){
if (cor2>=255) {
cor3++;
}
fill(cor2, cor, cor3);
ellipse(50, 250, 100, 100);//cabeça;
fill(50, 50, 50);
fill(255, 255, 255);
ellipse(70, 240, 20, 20);//olho
ellipse(30, 240, 20, 20);//olho
arc(50, 280, 30, 30, PI/50, PI);
cor++;
if (cor>=255) {
cor2++;
}
}
// john inicio
void desenhoJohn(){
//Cabeça
fill(#174962);
ellipse(200, 200, 100, 100);
//Olhos
fill(255);
ellipse(180, 190, 30, 30);
fill(#16A9F0);
ellipse(180, 190, 10, 20);
fill(255);
ellipse(220, 190, 30, 30);
fill(#16A9F0);
ellipse(220, 190, 10, 20);
//boca
fill(#F01811);
ellipse(200, 220, 40, 40);
//orelha
//Orelha
fill(#26AD9A);
ellipse(160, 150, 50, 50);
ellipse(240, 150, 50, 50);
//john fim
}
// Vera - Inicio
void veraS(){
float veraA = second();
float veraB = veraA*1.3;
veraA = veraA+20;
float corVA = random(235,255);
float corVB = random(100,135);
fill(corVA, corVB, 0);
strokeWeight(2);
ellipse(veraA+150, veraB+119, 50, 60);
rect(veraA+130, veraB+150, 44, 90);
arc(veraA+129, veraB+242, 90, 60, 0, PI*1.5);
arc(veraA+116, veraB+165, (veraB/8)+25, 10, 0, PI*2);
arc(veraA+188, veraB+165, (veraB/8)+25, 10, 0, PI*2);
triangle(veraA+175, veraB+140, veraA+175, veraB+110, veraA+190, veraB+110);
triangle(veraA+125, veraB+140, veraA+125, veraB+110, veraA+110, veraB+110);
line(veraA+139, veraB+114, veraA+144, veraB+114);
line(veraA+159, veraB+114, veraA+164, veraB+114);
arc(veraA+150, veraB+135, 20, 15, 0, PI);
}
// Vera - Fim
//COLOCAR FUNÇOES DESENHA BIXOS
//CALEB
void pintaOlho(){
//desenho Caleb
stroke(0);
strokeWeight(1);
movOlhoX=random(-2,2);
movOlhoY=random(-2,2);
velOlhoX =random(4.8);
velOlhoY =random(2.5);
//algoritimo para roll over
distancia=dist(mouseX,mouseY,x,y);
if(distancia<t/2&&mousePressed){
//olho fechado
fill(255);
ellipse(x,y,t+5,t-5);
line(x-t/2,y,x+t/2, y);
}else{
fill(255);
ellipse(x,y,t,t);
fill(0);
ellipse(x,y,t/2,t/2);
stroke(0);
fill(255);
ellipse(x,y,t/10,t/10);
//stroke(255,0,0);
//strokeWeight(random(2,10));
//line(x,y,random(width),random(height));
}
}
void moveOlho(){
x=x+(movOlhoX*velOlhoX);
y=x+(movOlhoY*velOlhoY);
if(x<=0||x>width-t){
movOlhoX *=-1;
}
if (y<=0 || y>=height-t){
movOlhoY *=-1;
}
}
//inicioJac
void jac(){
pushMatrix();
translate(300,0);
xJac=(mouseX-pmouseX)/8;
YJac=(mouseY-pmouseY)/8;
posxJac1=posxJac1+xJac;
posxJac2=posxJac2+xJac;
posYJac1=posYJac1+YJac;
posYJac2=posYJac2+YJac;
pushMatrix();
rotate(PI/20);
translate(20,-40);
fill(255);
beginShape();
vertex(241.0, 142.0);
bezierVertex(241.0, 142.0, 302.0, 84.0, 343.0, 145.0);
bezierVertex(384.0, 216.0, 214.0, 187.0, 242.0, 144.0);
endShape();
fill(0);
popMatrix();
ellipse(posxJac1, posYJac1, 50, 50);
pushMatrix();
translate(-180, 110);
rotate(-PI/9);
fill(255);
beginShape();
vertex(241.0, 142.0);
bezierVertex(241.0, 142.0, 302.0, 84.0, 343.0, 145.0);
bezierVertex(384.0, 216.0, 214.0, 187.0, 242.0, 144.0);
endShape();
fill(0);
popMatrix();
ellipse(posxJac2, posYJac2, 50, 50);
fill(255);
if(mousePressed){
pushMatrix();
translate(30,40);
beginShape();
vertex(124.0, 190.0);
bezierVertex(124.0, 190.0, 185.0, 278.0, 262.0, 191.0);
endShape();
popMatrix();
}
popMatrix();
//fimJac
}