## Mario-Code-Day3

//Day_3_Homework_Program_1
//Mario_Dcunha

//int r=243, g=237, b=177;

//Define Center Points
int x=0, y=0, r=0, g=0, b=0, rLimit, lLimit, tLimit, bLimit, diameter=50, dir=1, xSpeed=5, ySpeed=4, xc=100, yc=250, a=0, d=0, c=0;

void setup()
{
size(1000,400);
smooth();
background(243,237,177);
}

void draw()
{

noStroke();
//Taking a center for concentric circles
pick_center(150,150);

//Drawing the white concentric circles
circle(255,255,255, 160);

//Insert the white cirlce behind
stroke(0); strokeWeight(2);
pick_center(100,230);
circle(255,255,255,60);

noStroke();
pick_center(150,150);

circle(r,g,b, 150);
circle(32,157,29, 90);

if(mousePressed)
{
circle(r++,g++,b–, 90);
}

circle(0,0,0,75);
circle(59,131,119,60);
circle(0,0,0,50);

if(mousePressed && r>200 && b<200)
{
r–; g–; b++;
circle(r,g,b,60);
}
//Draw the final black loop
//pick_center(150,150);
noFill(); stroke(0); strokeWeight(5);
ellipse(150, 150, 165, 165);

x=width/2;
y=height/2;

noStroke();

pick_center(xc,yc);

circle(0,0,0,60);
circle(235,208,118,50);
circle(255,255,255,40);

rLimit = width-(diameter/2);
lLimit = 0+(diameter/2);
tLimit = 0;
bLimit = height;

if(xc>rLimit)
xSpeed = -dir * xSpeed;

xc = xc + xSpeed;

if(xc<lLimit)
xSpeed = -dir * xSpeed;

if(yc>bLimit)
ySpeed = -dir * ySpeed;

yc = yc + ySpeed;

if(yc<tLimit)
ySpeed = -dir * ySpeed;

//Rectangle Thing

pushMatrix(); // Store the current transformation settings.
translate(800,150);
rotate(-PI/4.0);

a=197; d=70; c=42;

if(mousePressed)
{
a=d; d=c; a++; c=a;

}

fill(a,d,c);
rect(0,0,80,80);
fill(c++,d,a);
rect(40,0,40,40);
rect(0,40,40,40);
fill(a,c,d);
rect(40,40,40,40);

strokeWeight(2);
line(0, 0, -80, 40);
line(0, 20, -80, 40);
line(0, 40, -80, 40);
line(0, 60, -80, 40);
line(0, 80, -80, 40);

noStroke();
fill(197,70,42);
triangle(-80, 40, -20, 200, -65, 120);
popMatrix(); // Restore the previous transformation settings.

}

void circle(int r, int g, int b, int diameter)
{
fill(r, g, b);
ellipse(x, y, diameter, diameter);
}

void pick_center(int center_x, int center_y)
{
x = center_x;
y = center_y;
}