abstract class demo 
{
  public demo() {
  }
  
  void playDemo(){
  }
}
class Road{

  float yCoord;
  float xCoord;
  float zCoord;
  
  ArrayList<roadStrip> stripList;
  MistGenerator mistGenerator1;
  MistGenerator mistGenerator2;
  MistGenerator mistGenerator3;
  public Road() {
    zCoord = -1000;
    
    mistGenerator1 = new MistGenerator(100, 100, -500);
    mistGenerator2 = new MistGenerator(width - 100, 100, -500);
    mistGenerator3 = new MistGenerator(width/2, 100, -500);
    
    stripList = new ArrayList<roadStrip>();
    stripList.add(new roadStrip(-1 * 500));
    stripList.add(new roadStrip(-1 * 1000));
    stripList.add(new roadStrip(-1500));
  }
  
  void update(int r, int g, int b) {
    if(stripList.size() < 3) {
      stripList.add(new roadStrip(-1000));
    }
    
    mistGenerator1.draw(r, g, b);
    mistGenerator2.draw(r, g, b);
    mistGenerator3.draw(r, g, b);
    
    for(int i = 0; i < stripList.size(); i++) {
      roadStrip road = stripList.get(i);
      road.update(r, g, b);
    }
  }
}
class roadStrip {
  float yCoord;
  float xCoord;
  float zCoord;
  
  public roadStrip(float z) {
    zCoord = z;
  }
  
  void update(int r, int g, int b) {
    pushMatrix();
    stroke(10+r, 10+g, 10+b, zCoord * -1);
    strokeWeight(10);
    line(-1500, height - 100, 100 + zCoord, width + 1500, height - 50, zCoord);
    popMatrix();
    
    zCoord += 10;
    if(zCoord > 100){
      zCoord = -1500;
    }
  }
}