int [] moveTutle = {
100, 300
};
int [] size = {
10, 20, 40
};
int [] colorr = {
255, 153, 102
};
int a = 500;
void setup () {
size (300, 600);
background (255);
}
void draw () {
background (255);
int moveTutleY = a;
if (mouseX<=mouseY) {
background (0, 0, 204);
}
for (int i=0; i<moveTutle.length; i++) {
draw_tutle (moveTutle[i], size[i], colorr[i]);
}
draw_tutle (moveTutleY, size[2], colorr[2]);
a = a - 1;
if (a <= 0) {
a = height;
}
}
void draw_tutle (int moveTutle, int size, int colorr) {
noStroke ();
fill (255, 102, 0);
ellipse ((width/2)-50, moveTutle-40, size, size/2);
ellipse ((width/2)+50, moveTutle-40, size, size/2);
ellipse ((width/2)-50, moveTutle+40, size, size/2);
ellipse ((width/2)+50, moveTutle+40, size, size/2);
ellipse (width/2, moveTutle-75, size, size+30);
fill (colorr, 51, 0);
ellipse (width/2, moveTutle, size+80, size+130);
fill (colorr, 204, 0);
ellipse (width/2, moveTutle, size+60, size+110);
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น