/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://designuniandes.sketchpad.cc/sp/pad/view/ro.rDRlNn7CB4b/rev.1
*
* authors:
* Victor Mahecha
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
// This sketch builds on a prior work, "Assignment 3: Movement", created by Hernando Barragan
// http://designuniandes.sketchpad.cc/sp/pad/view/ro.B7dgIfNu$GCReL/rev.1
float x = 151;
float y = 1;
float y1 = 1;
float r = -100;
float a = -200;
float p = 200;
void setup() {
size (400, 400);
}
void draw()
{
background(100, 100, 230);
noStroke();
// fondo
//nube
fill(255);
ellipse (r+30, 60, 50, 30);
ellipse (r+55, 60, 40, 40);
ellipse (r+90, 60, 50, 50);
ellipse (r+120, 65, 40, 30);
ellipse (r-30, 20, 50, 30);
ellipse (r-55, 20, 40, 40);
ellipse (r-90, 20, 50, 50);
ellipse (r-120, 25, 40, 30);
ellipse (r-130, 80, 50, 30);
ellipse (r-155, 80, 40, 40);
ellipse (r-190, 80, 50, 50);
ellipse (r-220, 85, 40, 30);
ellipse (a-30, 180, 50, 30);
ellipse (a-55, 180, 40, 40);
ellipse (a-90, 180, 50, 50);
ellipse (a-120, 185, 40, 30);
ellipse (a-130-20, 40, 50, 30);
ellipse (a-155-20, 40, 70, 40);
ellipse (a-190-20, 40, 50, 50);
ellipse (a-220-20, 45, 40, 30);
/// cuerpo
fill(255, 100-(50*y), 0);
rect(70, 200, 260, 80);
ellipse (80, 240, 70, 80);
ellipse (320, 240-x*0.3+55, 70, 80);
fill(255, 100+(50*y), 0);
rect(100, 200, 200, 150);
ellipse (200, 340, x*0.3 +200, x*0.3 +200);
fill(255);
rect(100, 220, 200, 20);
rect(100, 260, 200, 20);
rect(100, 300, 200, 20);
rect(100, 340, 190+x*0.1, 20);
rect(100, 380, 200+x*0.1, 20);
rect(100, 390, 190+x*0.1, 20);
// cara
fill(226, 175, 120);
ellipse (200, 100, 150, 160);
rect(180, 165, 40, 36);
fill(206,149,104);
ellipse(170, 83, x*0.09+2, 15);
fill(206,149,104);
ellipse(230, 83, x*0.09+2, 15);
fill(0);
ellipse(170, 80, 10, 10);
fill(0);
ellipse(230, 80, 10, 10);
//Boca
fill(225, 30, 30);
rect(180, 150, 40, 15);
fill(255);
rect(180, 150, 40, 2);
rect(180, 165, 40, 2);
fill(226, 175, 120);
rect(180, 168, 40, x-175);
fill(206, 149, 104);
rect(170*0.1+175, (x*0.2)+135, x*0.1, 3);
//pelo
fill(0, 22, 0);
triangle(172, 30, p, 0, 228, 30);
triangle(172-20, 40, p-40, 5, 228-20, 30);
triangle(172+40, 30, p+40, 5, 228+30, 50);
fill(206, 149, 104);
triangle(192, 140, 200, 140, 200, 100);
/// brazos
fill(206,149,104);
rect(50,260,50,150);
rect(300,260-x*0.3+40,50,130);
fill(82,45,6);
rect(210,215-x*0.3,50,80);
fill(24,199,0);
rect(210,235-x*0.3,50,80);
fill(226,175,120);
quad(270, 235-x*0.3+40, 210, 235-x*0.3+40, 290, 390-x*0.3+40, 350, 390-x*0.3+40);
/////
p = p+1*y;
if (p> 220 || x< 180)
{
y1 = y1 *-1;
}
x = x+1*y;
if (x> 180 || x< 150)
{
y = y *-1;
}
r = r+5;
if (r == 700)
{
r=-100;
}
a= a+5;
if (a == 600)
{
a=-200;
}
}