int c2 = 0;
int c3 = 0;
int c4 = 0;
int c5 = 0;
int c6 = 0;
int c7 = 0;
int c8 = 0;
int c9 = 0;
int c10 = 0;
int c11 = 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 = 100;
int h = 100;
fill(c1);
ellipse(xx+150, yy+150, w+200, h+200); //วงกลมดำหน้า
fill(c2);
ellipse(xx+50, yy, w+55, h+55); //วงกลมดำหูขวา
fill(c3);
ellipse(xx+250, yy, w+55, h+55); //วงกลมดำหูซ้าย
fill(c4);
ellipse(xx+150, yy+180, w+170, h+150); //วงกลมแดงหน้า
fill(c5);
arc(xx+150, yy+150, w+170, h+150, PI/6, PI-PI/6); //ปากยิ้ม
fill(c6);
arc(xx+35, yy+190, w-70, h-50, PI/6, PI-PI/6); //มุมปากยิ้มขวา
fill(c7);
arc(xx+263, yy+190, w-70, h-50, PI/6, PI-PI/6); //มุมปากยิ้มซ้าย
fill(c8);
ellipse(xx+112, yy+150, w-50, h-20); //ตาขาวขวา
fill(c9);
ellipse(xx+182, yy+150, w-50, h-20); //ตาขาวซ้าย
fill(c10);
ellipse(xx+112, yy+160, w-70, h-50); //ตาดำขวา
fill(c11);
ellipse(xx+182, yy+160, w-70, h-50); //ตาดำซ้าย
fill(c12);
ellipse(xx+148, yy+210, w-50, h-50); //จมูก
}
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));
c8 = color(random(0, 225), random(0, 225), random(0, 225));
c9 = color(random(0, 225), random(0, 225), random(0, 225));
c10 = color(random(0, 225), random(0, 225), random(0, 225));
c11 = color(random(0, 225), random(0, 225), random(0, 225));
c12 = color(random(0, 225), random(0, 225), random(0, 225));
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น