วันอาทิตย์ที่ 30 สิงหาคม พ.ศ. 2558

Lab 2 : Positive sign (animetion)

int y=0;
void setup() {
  size(100, 300);
}
void draw() {
  background(255);
  frameRate(10);
  //function call
  draw_positive(25, y);
  y=(y+10)%height;
}
void draw_positive(int x, int y) {
  float sizePosi;
  //setting variable
  sizePosi=50;
  //positive
  fill(0);
  //vertical
  rect(x+(sizePosi/3), y, sizePosi/3, sizePosi);
  //horizon
  rect(x, y+(sizePosi/3), sizePosi, sizePosi/3);
}


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

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