Processing Assignment 1

For this first assignment I was just trying to practice writing the code with no mistakes and also getting used to the measurements and how the affect the placement of the shapes. It was actually pretty hard to get the placement right but I think I got a little better at understanding how they work together. I still wanted to make it fun so I made the background change colors randomly and when the mouse is pressed a randomly changing color oval appears in the existing oval.

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

void draw(){

background(random(10,100),random(10,100),random(10,100));
if (mousePressed){
fill(random(0,255));
ellipse(300,300,150,75);
}

stroke(0);
strokeWeight(10);
fill(240,234,215);
rect(200,90,200,100);

stroke(146,159,170);
strokeWeight(5);
fill(196,144,152);
ellipse(300,300,200,100);

stroke(0);
strokeWeight(10);
fill(240,234,215);
rect(200,390,200,100);

stroke(0);
strokeWeight(10);
fill(240,234,215);
rect(50,90,60,100);

stroke(0);
strokeWeight(10);
fill(240,234,215);
rect(50,390,60,100);

stroke(0);
strokeWeight(10);
fill(240,234,215);
rect(480,390,60,100);

stroke(0);
strokeWeight(10);
fill(240,234,215);
rect(480,90,60,100);

frameRate(5);
}

By Afnan Ellythy