xxxxxxxxxx
28
class Ripple {
constructor(clickX, clickY, rw, rh) {
this.clickX = clickX;
this.clickY = clickY;
this.rw = rw; //ripple width
this.rh = rh; //ripple height
//creating variables for color values
this.red = random(0,255);
this.blue = random(0, 255);
}
run() {
this.display();
this.grow();
}
display() {
stroke(this.red, 0, this.blue, 150);
strokeWeight(5);
noFill();
ellipse(this.clickX, this.clickY, this.rw, this.rh);
}
grow() {
this.rw += 2;
this.rh++;
}
}