class PerlinWalker {
constructor(sketch){
this.sketch = sketch;
this.position = sketch.createVector(container.width/2, container.height/2);
this.noff = sketch.createVector(sketch.random(1000), sketch.random(1000));
}
display() {
this.sketch.strokeWeight(2);
this.sketch.fill(51);
this.sketch.stroke(0);
this.sketch.ellipse(this.position.x, this.position.y, 48, 48);
}
walk() {
this.position.x = this.sketch.map(this.sketch.noise(this.noff.x),0,1,0, container.width);
this.position.y = this.sketch.map(this.sketch.noise(this.noff.y),0,1,0, container.height);
this.noff.add(0.01,0.01,0);
}
}