Matthew Soto 2/19/13 HW 3.3

int x= 1;
int speed= 1;
float r= 255;
float g= 0;
float b=4;

void setup(){
size(800, 800);
}

void draw(){
background(0);
fill(255);
ellipse(x, 200, 100, 100);

if(x>width){
speed=speed* -1;
fill(255, 0, 4);
ellipse(x, 200, 100, 100);
}
else if (x<0){
speed=speed* -1;
fill(13, 34, 255);
ellipse(x, 200, 100, 100);
}

x=x+speed;
}
void mouseDragged(){//when you drag it gives you the different shades of night.
background(255, 0, 4);//sky, light blue
background (mouseX,mouseY);
}

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *