void setup()
{
size (500,660);
background (0);
draw_football_fill(150,20,40,20);
draw_football_fill(200,70,40,340);
}
void draw_football_fill(int filed_color_green,int filed_color_blue,int filed_width,filed_length){
stroke(255);
strokeWeight(4);
fill(0, filed_color_green, filed_color_blue);//filed color
rect(13+filed_width,14+filed_length,400,270);//field
line(215+filed_width, 280+filed_length, 215+filed_width, 15+filed_length);//half-way line
strokeWeight(3);
rect(13+filed_width,75+filed_length,70,150);//penalty area left
rect(343+filed_width,75+filed_length,70,150);//penalty area right
rect(13+filed_width,107+filed_length,30,90);//goal
rect(383+filed_width,107+filed_length,30,90);//goal
int center_radius=70;
ellipse(215+filed_width,150+filed_length,center_radius,center_radius);
//centre circle
arc(342+filed_width,152+filed_length,50,50, PI/2,TWO_PI-PI/2);
arc(85+filed_width,152+filed_length,50,50, -PI/2,PI/2);
arc(16+filed_width, 16+filed_length, 20, 20, 0, PI/2);
arc(410+filed_width, 16+filed_length, 20, 20, PI/2, PI);
arc(410+filed_width, 281+filed_length, 20, 20, PI, TWO_PI-PI/2);
arc(16+filed_width, 281+filed_length, 20, 20, TWO_PI-PI/2, TWO_PI);
fill(255);
ellipse(62+filed_width, 151+filed_length, 5, 5);
ellipse(362+filed_width, 151+filed_length, 5, 5);
ellipse(215+filed_width, 151+filed_length, 5, 5);//centre spot
}
วันอาทิตย์ที่ 7 กันยายน พ.ศ. 2557
L.2 Football-field
สมัครสมาชิก:
ส่งความคิดเห็น (Atom)
ไม่มีความคิดเห็น:
แสดงความคิดเห็น