วันจันทร์ที่ 1 กันยายน พ.ศ. 2557

The Turtle

 
float moveTutle = 150;

void setup () {
  size (300, 300);
  background (255);
}

void draw () {
  background (255);
  draw_tutle (moveTutle);
  moveTutle = moveTutle - 1;
  if (moveTutle <= 0) {
  moveTutle = height;
  }
}

void draw_tutle (float moveTutle) {
  noStroke ();
  fill (255, 102, 0);
  ellipse ((width/2)-50, moveTutle-40, 20, 10);
  ellipse ((width/2)+50, moveTutle-40, 20, 10);
  ellipse ((width/2)-50, moveTutle+40, 20, 10);
  ellipse ((width/2)+50, moveTutle+40, 20, 10);

  ellipse (width/2, moveTutle-75, 20, 50);

  fill (102, 51, 0);
  ellipse (width/2, moveTutle, 100, 150);
  fill (102, 204, 0);
  ellipse (width/2, moveTutle, 80, 130);
}

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

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