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

lab2 +

   float c1;
   float c2;
   float c3;
   float X;
   float Y;
void setup(){
size(500,500);
frameRate(60);
}
void draw(){

  background(0);
//color
  c1 = random(0,255);
  c2 = random(0,255);
  c3 = random(0,255);
//position
  X = random(1,250);
  Y = random(1,250);
//function
  plus(X,Y,250,250); // call function
}
void plus(int posX,int posY,int wide,int high){
  noStroke();
  fill(c1,c2,c3);
//positive
  rect(posX+75,posY, wide-150,high);
  rect(posX,posY+75, wide,high-150);
}

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

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