xxxxxxxxxx
26
function Ball(x,y){
this.pos = createVector(x,y);
this.prev = createVector(x,y);
this.vel = createVector(1,0);
this.acc = createVector(0,0);
this.size = random(10,20);
this.update = function() {
this.vel.add(this.acc);
this.vel.limit(5);
this.pos.add(this.vel);
this.acc.mult(0);
}
this.show = function(){
stroke(0)
fill(0)
circle(this.pos.x,this.pos.y,this.size);
this.prev.x = this.pos.x;
this.prev.y = this.pos.y;
}
}