Monday, July 9, 2012

Processing Assignment


int circleX=50;
int circleY=100;
int circlesizeX=60;
int circlesizeY=60;
int change=1;
int x=0;
int speed=1;

void setup (){
size(200, 200);
 smooth();
}


void draw (){


if (mouseX<width/3){
background(255);
}else if (mouseX<2*width/3){
  background(125);
}else{
  background(0);
}




circleX=circleX+change;
circleY=circleY+change;
circlesizeX=circlesizeX+1;
circlesizeY=circlesizeY+3;

x=x+speed;
if((x>width)||(x<0)){
  speed=speed*-1;
}

  ellipse(x, 100, 60, 60);
  stroke(60, 80, 30);
  fill (70, 200, 250);




line(width/3,0,width/3,500);
line(width*2/3,0,width*2/3,500);
}

No comments:

Post a Comment