วันอังคารที่ 2 กันยายน พ.ศ. 2557

Lab2 : turtle


void setup(){
size(400,400);
background(255,0,0);
draw_legRight(160,280,40,20);
draw_tail(250,250,20,10,3);
draw_body(190,250,140,80);
draw_shell(155,220,20,20,10);
draw_face(120,230,70,80);
draw_eye(100,220,15,15);
draw_mouse(90,250,100,250);
draw_legLeft(180,280,40,20);
}
void draw_legRight(int OriginalX,int OriginalY,int OriginalWidth,int OriginalHeight){ fill(255,255,153);
ellipse(OriginalX,OriginalY,OriginalWidth,OriginalHeight); //leg
}
void draw_tail(int OriginalX,int OriginalY,int OriginalWidth,int OriginalHeight,int OriginalRadius){
fill(255,255,153);
rect(OriginalX,OriginalY,OriginalWidth,OriginalHeight,OriginalRadius); //tail
}
void draw_body(int OriginalX,int OriginalY,int OriginalWidth,int OriginalHeight){ fill(0,153,0);
ellipse(OriginalX,OriginalY,OriginalWidth,OriginalHeight); //body
}
void draw_shell(int OriginalX,int OriginalY,int OriginalWidth,int OriginalHeight,int OriginalRadius){
fill(153,153,0);
rect(OriginalX,OriginalY,OriginalWidth,OriginalHeight,OriginalRadius); //shell rect(OriginalX+30,OriginalY,OriginalWidth,OriginalHeight,OriginalRadius); //shell rect(OriginalX+60,OriginalY,OriginalWidth,OriginalHeight,OriginalRadius); //shell
}
void draw_face(int OriginalX,int OriginalY,int OriginalWidth,int OriginalHeight){ fill(255,255,153);
noStroke(); ellipse(OriginalX,OriginalY,OriginalWidth,OriginalHeight); //face ellipse(OriginalX-10,OriginalY+20,OriginalWidth-10,OriginalHeight-40); //face
}
void draw_mouse(int OriginalX,int OriginalY,int OriginalWidth,int OriginalHeight){ stroke(2);
line(OriginalX,OriginalY,OriginalWidth,OriginalHeight); //mouse
}
void draw_eye(int OriginalX,int OriginalY,int OriginalWidth,int OriginalHeight){
fill(0);
ellipse(OriginalX,OriginalY,OriginalWidth,OriginalHeight); //eye
fill(255);
ellipse(OriginalX-5,OriginalY-3,OriginalWidth-10,OriginalHeight-10); //eye
}
void draw_legLeft(int OriginalX,int OriginalY,int OriginalWidth,int OriginalHeight){ fill(255,255,153);
ellipse(OriginalX,OriginalY,OriginalWidth,OriginalHeight); //leg ellipse(OriginalX+50,OriginalY,OriginalWidth,OriginalHeight); //leg
}

ไม่มีความคิดเห็น:

แสดงความคิดเห็น