2012年2月19日 星期日

3-1 (97473011 Alvin)


In this program. I learned about how to use mouseX,mouseY and can controll the circle following the postion of mouseX,Y


void setup()
 {
   size(800,600);
  background(200,0,255);
  smooth();
  noStroke();
  }
  void draw()
  {
    for(int y=100; y<=600;y+=200)
    {
      for(int x=100;x<=800;x+=200)
      {
        fill(250,180,80);
        ellipse(x,y,200,200);
       
        fill(100,80,290);
        ellipse(x+(mouseX-400)/11, y+(mouseY-300)/11,100,100);
       
        fill(60,255,60);
        ellipse(x+(mouseX-400)/11, y+(mouseY-300)/11,50,50);
      }
    }
  } 

沒有留言:

張貼留言