class Firefly { float x, y, w, xspeed, yspeed; //color c; Firefly(float x_, float y_, float w_){ x = x_; y = y_; w = w_; xspeed = pot1; yspeed = pot2; } void move() { x = pot1; if (x > width+100 || x < -100) { pot1 = pot1*-0.95; x = width; } y = pot2; if (y > height+100 || y < -100) { pot2 = pot2*-0.95; y = height; } } void display() { //fill(0); float r = pot1; float g = pot2; fill(r,g,0); if(r > 255) { r=255; } if(g > 255) { g=255; } noStroke(); ellipse(x, y, w, w); } }