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