/*Shane Banner Assignment 5 This program simulates a rainy rain storm. The background provides for a liquid like motion.*/ //First we define the rain background PImage rain; //And define all the variables int rw1=(int)random(0,width); int rh1=0; int rw2=(int)random(0,width); int rh2=-20; int rw3=(int)random(0,width); int rh3=0; int rw4=(int)random(0,width); int rh4=-40; int rw5=(int)random(0,width); int rh5=-50; int rw6=(int)random(0,width); int rh6=-30; //Now we start the void setup void setup(){ size (500,300); //Then we upload the image. rain = loadImage("Rain.jpg"); } //Now for the void draw void draw(){ //This puts the image in the background. image(rain,0,0); //Turn the stroke blue stroke(0,0,200); //Make them visible strokeWeight(5); //And this makes the raindrops line (rw1,rh1,rw1,rh1+15); line (rw2,rh2,rw2,rh2+15); line (rw3,rh3,rw3,rh3+15); line (rw4,rh4,rw4,rh4+15); line (rw5,rh5,rw5,rh5+15); line (rw6,rh6,rw6,rh6+15); //We make them move rh1+=1; rh2+=1; rh3+=1; rh4+=1; rh5+=1; rh6+=1; //Now we make them start over if they hit the end if (rh1>=300){ rh1*=0; rw1=(int)random(0,width); } if (rh2>=300){ rh2*=0; rw2=(int)random(0,width); } if (rh3>=300){ rh3*=0; rh3+=-20; rw3=(int)random(0,width); } if (rh4>=300){ rh4*=0; rh4+=-40; rw4=(int)random(0,width); } if (rh5>=300){ rh5*=0; rh5+=-50; rw5=(int)random(0,width); } if (rh6>=300){ rh6*=0; rh6+=-30; rw6=(int)random(0,width); } } /*And thats my cool rainstorm. Im finally starting to get the hang of the void */ //The rain all of a sudden started falling on the left but it fixes itself