// Declare and contruct two objects (h1, h2) from the class HLine HLine h1 = new HLine(200, 5.0); HLine h2 = new HLine(500, 10.5); void setup() { size(450, 450); frameRate(15); smooth(); } void draw() { background(0); stroke(255); h1.update(); h2.update(); } class HLine { float ypos, speed; float r = random(40); HLine (float y, float s) { ypos = y; speed = s; } void update() { ypos += speed; if (ypos > height) { ypos = 0; } line(0, ypos, width*50, ypos*30); line(0, ypos, width*5, ypos*10); fill(255, 100); rect(ypos*5, ypos, width/r, ypos); } }