your code sniplet looks good,
but not tells the whole story
if you do a
void draw() {
background(255);
}
you delete all and
might draw a grid and axis and ONE box.
( WHAT looks like jumping )
in that case you must remember the random positions like to a PVector[]
and do them in a loop all over again.
but if you not use the background thing it should work??