//this bubble class has changing color built in class BubbleX { color c; //variables float xpos; float ypos; float yspeed; float diam; float xvar; BubbleX(float tempXpos, float tempYpos, float tempYspeed) { //constructor xpos=tempXpos; ypos=tempYpos; yspeed=tempYspeed; } void display () { //function 1. displays the bubble float r=random(255); float g=random(255); float b=random(255); float a=random(0,255); diam=random(20,100); //c=color(r,g,b,a); noStroke(); fill(r,g,b,a); ellipse(xpos,ypos,diam,diam); } void move() { //function 2. makes the bubbles rise and move side to side xvar=random(-10,10); xpos=xpos-xvar; if (xpos<=diam/2) xpos=xpos+20; if (xpos>width) xpos=width-20; ypos=ypos-yspeed; if (ypos<=diam/2) { ypos=height; } //end of if }//end of move }//end of Bubble class