Fancy_Project#3B

Coding for my assignment 3B

//need to be able to set up a frame rate for the screen as well as a size.
void setup() {
size(400, 400);
frameRate(4);
smooth();

}
//names assigned to each individual item. you need to be able to call upon.
int pos = 0;
int saveNum=0;

void draw() {
exportFrame();

//background color
background(255);
// if any button is pressed it will result in the screen going completely black in color while if not pressed
screen will be white and display objects.
if(keyPressed == true) {
background(0);
}
//screen will display white.
else {
background(255);

// calling upon the rectangle where it is located 90, 180 somewhat middle of the screen.
pos++;
rect(pos, 90, pos, 180);
fill(0);
if (pos > width)
pos = 0;

//the ellipse will move based upon where the mouse X AND Y are located watch as it follows on the screen.
ellipse(mouseX, mouseY, 60, 60);

 
println(“mouseX = ” + mouseX, “mouseY = ” + mouseY);
//this will make the
fill( random(255), random(255), random(255), random(255));
}
}

 

//pressing s as either small letter or capital letter will allow you to save the image in the folder that the code is saved to.
void exportFrame() {
if(keyPressed){
if(key == ‘s’ || key == ‘S’) {
save(“masterpiece” + saveNum + “.png”);
saveNum++;
}
}
}

20140326-013946.jpg

20140326-013959.jpg

20140326-014007.jpg

20140326-014052.jpg

20140326-014218.jpg

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: