class Fog { float xpos; float ypos; float ypos2; float speed; float speed2; float[] vals; Fog(){ //xpos = random(0,width); xpos = 0; ypos = 0; ypos2 = 0; speed = random(5); speed2 = random(2); vals = new float[width]; for (int i =0; i < vals.length; i++) vals[i] = random(1,20); } void move(){ ypos += speed; ypos2 += speed2; } //Check if it hits the bottom boolean rechedbottom() { if(ypos>height || ypos2>height){ return true; } else{ return false; } } void display(){ fill(255,2); float f1 = 0.0; beginShape(POLYGON); int count1 = 0; for(int i=0; i0; j--){ vertex(xpos+j, 120+ypos2+random(-10,10)); } endShape(); } }