xxxxxxxxxx
24
function Particle(x, y) {
this.gravity = 0.1;
this.x = x;
this.y = y;
this.yspeed = 0;
this.update = function() {
this.y += this.yspeed;
this.yspeed += this.gravity;
if (this.y > height) {
this.y = height;
this.yspeed *= -0.9;
}
}
this.show = function() {
fill(0);
noStroke();
smooth();
ellipse(this.x, this.y, 50);
}
}