void setup() {
size(500, 500);
strokeWeight(5);
}
void draw() {
background(#FF1493);
wing = mouseY;
if (frameCount%30>10) {
wing+=20;
} else {
wing-=70;
}
if (mouseY <= 250) {
wing+= 10;
} else {
wing-= 60;
}
draw_bird(mouseX, mouseY);
}
//bird
void draw_bird(float x, float y) {
int rx = 100;
int ry = 100;
fill(#000080);
ellipse(x, y, rx, ry);
fill(225);
ellipse(x-10, y-10, rx-90, ry-90);
ellipse(x+10, y-10, rx-90, ry-90);
line(x+50, y, x+150, wing);
line(x-50, y, x-150, wing);
fill(#FFFF00);
triangle(x, y+40, x-10, y+5, x+10, y+5);
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น