xxxxxxxxxx
24
class Walker {
constructor(x, y, shape) {
this.x = x;
this.y = y;
this.px = x;
this.py = y;
}
update() {
this.px = this.x;
this.py = this.y;
this.x += random(-5, 5);
this.y += random(-5, 5);
}
show() {
ellipseMode(CENTER);
noStroke();
fill(random(255), random(255), random(255));
ellipse(this.x, this.y, 20, 20);
}
}