xxxxxxxxxx
//Project 2 - Complex Shape
//CTCH240 - Created by: Jill Schmidt
//Date Finished: 02/13/17
float x, y, w;
float spdX, spdY, theta, rotSpd;
void setup(){
background(0);
fullScreen();
x = width/10;
y = height/10;
w =150;
spdX= 15;
spdY = 5;
rotSpd = PI/30;
noFill();
stroke(255);
}//end setup
void draw(){
{stroke(255);
pushMatrix();
translate(x,y);
rotate(theta);
rect(-w/9,-w/5,w,w);
popMatrix();
x += spdX;
y += spdY;
theta+= rotSpd;
collide();
}
{
stroke(255,random(255));
ellipse(random(width),random(height),random(5,20),random(5,20));
stroke(255,random(255));
ellipse(random(width),random(height),random(50,50),random(50,50));
if(mousePressed){
noStroke(); fill(0);
rect(width/5,height/5,600,600);
}
if (mousePressed && (mouseButton == LEFT)) {
fill(random(255));
}
}
} //enddraw