import java.awt.Point;

float x, y, vx, vy;
Point[] target;
int t;

void setup() {
size(500, 500);
noStroke();
smooth();
target = new Point[10];
for (int i = 0; i < 10; i++) {
target[i] = new Point((int)random(500), (int)random(500));
}
x = y = vx = vy = 0;
t = 0;
}
void draw() {
background(0xFFFFFF);
x += vx;
y += vy;
if (x != target[t].x && y != target[t].y) {
vx = (target[t].x - x) / 2;
vy = (target[t].y - y) / 2;
} else {
t++;
if (t >= 10) t = 0;
}
fill(0);
ellipse(x, y, 10, 10);
}