class Leader { float x, y; float lastx, lasty; Leader() { setPosition(width/2, height/2); } Leader (float _x, float _y) { setPosition(_x, _y); } void setPosition(float _x, float _y) { x = _x; y = _y; } // move is expected to be overridden // (the default is purely random movement, ignoring timeslice) void move(float dt) { lastx = x; lasty = y; x = random(width); y = random(height); } // drawing a leader would be mainly for debugging purposes // (normally would draw those objects that follow the leader) // (stroke is expected to be set elsewhere) void draw() { point(x,y); } }