1.10.13

ICM Week 4

Object Arrays: Multiplicity 


                           
                                     


The CODE:

Claire [] clairesies=new Claire [100];

void setup(){
size(1000,1000);
smooth();

for(int i=0; i < clairesies.length; i++){
  clairesies[i]= new Claire(random(70,900),650);
}
}
void draw(){
  background(random(0,255), 230, 240);
  for(int i=0;i<clairesies.length; i++){
  clairesies[i].display();
  clairesies[i].dance();
  frameRate(15);
  }
  if(mousePressed){
    fill(255);
    rect(200,800,600,150);
    stroke(0);
    line(415, 800, 415, 760);
    line(445, 800, 445, 760);
    fill(255, 90);
    ellipseMode(CORNER);
    ellipse(415, 760, 30, 5);
    fill(205,175,149);
    rectMode(CORNER);
    rect(415, 770, 30, 30);
    textSize(75);
    fill(255, 0,0);
    text("LAST CALL!", 70, 150); 
    line(265,160, 100, 230);
  }
}

/////////CLASS

class Claire{
  //claire variables
  float x,y;

  
  
  Claire(float tempX, float tempY){
   x=tempX;
   y=tempY;
  }
//move claire
   
void dance(){
     x=x+random(-100,100);
     y=y+random(-10,10);
     x=constrain(x,0,width);
     y=constrain(y,0,height);
   }
   
//display
void display(){
ellipseMode(CENTER);
rectMode(CENTER);
//HAIR
fill(0);
stroke(0);
ellipse(x,y,210,310);
//neck
fill(255, 210, 200);
ellipseMode(CENTER);
ellipse(x,y+115,65,190);
//face
fill(255, 210, 200);
ellipseMode(CENTER);
ellipse(x,y-40,135,180);

//mouth
fill(255,0,0);
//stroke(255,0,0);
 arc(x, y+13, 45, 18, 0, PI);
//nose
fill(255, 210, 200);
stroke(0);
//arc(x-7, y-5, x-285, y-145, PI*3/2);
stroke(0);
//arc(x+8, y-5, x-285, y-145, 0,PI/2);
//BRIDGE
fill(255, 210, 200);
stroke(0);
ellipseMode(CENTER);
ellipse(x,y-20,24,50);
fill(255, 210, 200);
stroke(255,210,200);
ellipseMode(CENTER);
ellipse(x,y-28,37,50);
//hair
fill(0);
stroke(0);
rect(x,y-105,116,50);
//body
fill(0);
stroke(0);
rect(x,y+245,120,340);
//boobs
fill(0);
stroke(0);
ellipseMode(CENTER);
ellipse(x,y+135,145,100);
//butt
fill(0);
stroke(0);
ellipseMode(CENTER);
ellipse(x,y+245,145,100);
//leg hole
stroke(0, 230, 240);
fill(random(0,255), 230, 240);
rectMode(CENTER);
rect(x,y+355,50,130);
//left foot
fill(255, 210, 200);
stroke(0);
ellipseMode(CORNERS);
ellipse(x-105,y+400,x-15,y+445);
//right foot
ellipseMode(CORNERS);
ellipse(x+20,y+400,x+110,y+445);
//arms
line(x,y+145,x-220,y+5);
line(x+40,y+70,x+140,y+220);
//lefthand
ellipseMode(CORNERS);
ellipse(x-240,y-5,x-205,y+15);
//righthand
ellipseMode(CORNERS);
ellipse(x+140,y+215,x+175,y+235);
//left thumb
ellipseMode(CORNERS);
ellipse(x-207,y-15,x-202,y+5);
//right thumb
ellipseMode(CORNERS);
ellipse(x+140,y+220,x+145,y+240);
//shoes
//left shoe
fill(0);
line(x+205, y+445,x-15, y+445);
ellipse(x-105,y+400,x-15,y+445);
//right shoe
line(x+20, y+445, x+110, y+445);
ellipse(x+20,y+400,x+110,y+445);
//right eye
fill(255);
stroke(0);
ellipseMode(CENTER);
ellipse(x+30,y-45,28,15);
//left eye
fill(255);
stroke(0);
ellipseMode(CENTER);
ellipse(x-30,y-45,28,15);
//right pupil
fill(0);
ellipseMode(CENTER);
ellipse(x+30,y-45,10,10);
//left pupil
fill(0);
ellipseMode(CENTER);
ellipse(x-30,y-45,10,10);
//LEFT sock
stroke(0);
fill(255);
rectMode(CORNER);
rect(x-62,y+385,38,14);
//RIGHT sock
stroke(0);
fill(255);
rectMode(CORNER);
rect(x+24,y+385,38,14);
//CHAINZ
fill(0);
stroke(255,215,0,200);
arc(x,y+100,70,125,0,PI);
//left brow
fill(255, 210, 200);
stroke(0);
arc(x-31,y-57,30,9,-PI,0);
//right brow
fill(255, 210, 200);
stroke(0);
arc(x+31,y-57,30,9,-PI,0);
   }
}