class Walker { float x; float y; Walker() { x = width / 2; y = height / 2; } void display() { stroke(0); point(x, y); } void step() { float sx = random(-1, 1); float sy = random(-1, 1); x += sx; y += sy; } } Walker w; void setup() { size(640, 360); w = new Walker(); background(255); } void draw() { w.step(); w.display(); }