Tuesday, 2 September 2014

Animation Football Field lab 2

void setup(){
  size(500, 300);
  frameRate(30);
}
float g = 180;
float c = 0;
void draw(){
  if(c == 0){draw_fbf(); g = g - 0.5;if(g < 100){c = 1;}}
  if(c == 1){draw_fbf(); g = g + 0.5;if(g > 180){c = 0;}}
}

void draw_fbf(){
  background(70, g, 70);
  stroke(255);
  strokeWeight(10);
line(0, 0, 500, 0);
line(0, 0, 0, 300);
line(500, 300, 500, 0);
line(0, 300, 500, 300);
line(250, 0, 250, 300);
noFill();
ellipse(250, 150, 100, 100);
line(500, 100, 430, 100);
line(500, 200, 430, 200);
line(430, 200, 430, 100);
line(0, 100, 70, 100);
line(0, 200, 70, 200);
line(70, 200, 70, 100);
arc(0, 0, 60, 60, 0, PI/2);
arc(500, 300, 60, 60, PI, TWO_PI-PI/2);
arc(500, 0, 60, 60, PI/2, PI);
arc(0, 300, 60, 60, TWO_PI-PI/2, TWO_PI);
}


No comments:

Post a Comment