class Walker { constructor(x = 0, y = 0) { this.x = x this.y = y } step() { let dx = min(floor(random(4)) - 1, 1); let dy = min(floor(random(4)) - 1, 1); this.x += dx this.y += dy } draw() { stroke(0) point(this.x, this.y) } } let walker function setup() { createCanvas(640, 240) background(255) walker = new Walker(320, 120) } function draw() { walker.step(); walker.draw(); }