class Anomaly 
{

  float yCoord;
  float xCoord;
  float zCoord;
  
  float xVelocity;
  float yVelocity;
  
  float yGround;
  
  float angle;
  public Anomaly(float xCoord) {
    yGround = height  - 200;
    
    this.xCoord = xCoord;
    yCoord = height  - 200;
    
    zCoord = -400;
    angle = 0;
  }
  
  void bounce(){
    if(yVelocity > -30)
      yVelocity -=  random(15, 25);
  }
  
  void draw(int r, int g, int b, float high) {
   yCoord += yVelocity; 
   zCoord -= random(-10, 10) / 10;
   
   if(yCoord > yGround) {
     yCoord = yGround;
     yVelocity = 0;
   }
   
   pushMatrix();
   translate(xCoord, yCoord, zCoord);
   fill(0,0,0,255);
   rotateX(radians(angle));
   strokeWeight(1);
   stroke(r, g, b);
   //noFill();
   //stroke(255);
   sphere(300 + high);
   popMatrix();
   
   yVelocity += 8;
   angle += 8;
   }
}