float y = 50.0; float speed = 16; float radius = 2.5; float z = y + 5; void setup(){ size(640,480); background(50); } void draw(){ steppedGradientBackground(50); thing1(); thing2(); } void steppedGradientBackground(int bandHeight){ smooth(); fill(0); rect(0,0,640,480); int y = 0; noStroke(); for (int n = 0; n <= 255; n += 10) { fill(255, 255, 255, n); rect(0, y, 640, y+bandHeight); y += bandHeight; } } void thing1(){ fill(255); stroke(0); strokeWeight(18); beginShape(); vertex(170,160); bezierVertex(130,150,130,190,150,210); bezierVertex(140,215,130,240,170,250); endShape(); beginShape(); vertex(470,160); bezierVertex(510,150,510,190,490,210); bezierVertex(500,215,510,240,470,250); endShape(); ellipse(320, 220, 280, 360); // face strokeWeight(15); ellipse(280,200,30,30); ellipse(360,200,30,30); line(260,90,380,90);//san de zuihou yiheng line(270,110,370,110);//san de zuihou yiheng line(260,130,380,130);//san de zuihou yiheng line(240,160,400,160);//ding de heng line(320,161,320,290);//ding de shu line(319,289,305,275);//ding de gou strokeJoin(ROUND); rect(270,300,100,40);//mouth line(300,300,305,340); line(340,300,330,340); noStroke(); fill(#ff9dbb); ellipse(240,230,40,25); ellipse(400,230,40,25); } void thing2(){ smooth(); noStroke(); fill(#ff9dbb); ellipseMode(RADIUS); ellipse(z, y, radius, radius); y = y + speed; if (y > height+radius) { y = -radius; } ellipse(z+50, y+5, radius, radius); y = y + speed; if (y > height+radius) { y = -radius; } ellipse(z+200, y, radius, radius); y = y + speed; if (y > height+radius) { y = -radius; } ellipse(z+220, y+5, radius, radius); y = y + speed; if (y > height+radius) { y = -radius; } ellipse(z+450, y, radius, radius); y = y + speed; if (y > height+radius) { y = -radius; } ellipse(z+545, y+2, radius, radius); y = y + speed; if (y > height+radius) { y = -radius; } ellipse(z+550, y+5, radius, radius); y = y + speed; if (y > height+radius) { y = -radius; } ellipse(z+570, y, radius, radius); y = y + speed; if (y > height+radius) { y = -radius; } }