int c2 = 0;
int c3 = 0;
int c4 = 0;
int c5 = 0;
int c6 = 0;
int c7 = 0;
int c12 = 0;
void setup()
{
size(500, 550);
}
void draw() {
background(0);
int x = mouseX;
int y = mouseY;
mickey(x, y);
}
void mickey(int xx, int yy) {
int w = 10;
int h = 10;
int n = 0;
int m = 0;
while (n<2) {
fill(c1);
ellipse(xx+150+m, yy+150+m, w+200, h+200); //วงกลมดำหน้า
fill(c2);
ellipse(xx+50+m, yy+m, w+55, h+55); //วงกลมดำหูขวา
fill(c3);
ellipse(xx+250+m, yy+m, w+55, h+55); //วงกลมดำหูซ้าย
fill(c4);
ellipse(xx+150+m, yy+180+m, w+170, h+150); //วงกลมแดงหน้า
fill(c5);
arc(xx+150+m, yy+150+m, w+170, h+150, PI/6, PI-PI/6); //ปากยิ้ม
fill(c6);
arc(xx+35+m, yy+190+m, w-70, h-50, PI/6, PI-PI/6); //มุมปากยิ้มขวา
fill(c7);
arc(xx+263+m, yy+190+m, w-70, h-50, PI/6, PI-PI/6); //มุมปากยิ้มซ้าย
fill(c12);
ellipse(xx+148+m, yy+210+m, w-50, h-50); //จมูก
n++;
m += 200;
}
}
void mousePressed() {
c1 = color(random(0, 225), random(0, 225), random(0, 225));
c2 = color(random(0, 225), random(0, 225), random(0, 225));
c3 = color(random(0, 225), random(0, 225), random(0, 225));
c4 = color(random(0, 225), random(0, 225), random(0, 225));
c5 = color(random(0, 225), random(0, 225), random(0, 225));
c6 = color(random(0, 225), random(0, 225), random(0, 225));
c7 = color(random(0, 225), random(0, 225), random(0, 225));
c12 = color(random(0, 225), random(0, 225), random(0, 225));
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น