varposition,velocity,rand=Math.random,radius=rand()*28+6,diameter=radius*2;functionsetup(){// It seems we can't use createVector before setupposition=createVector(100,100);velocity=createVector(rand()*4,rand()*4);createCanvas(500,200).parent('canvas-container');}functiondraw(){position.add(velocity);if((position.x>width-radius)||(position.x<radius)){velocity.x=velocity.x*-1;}if((position.y>height-radius)||(position.y<radius)){velocity.y=velocity.y*-1;}render(position);}functionrender(position){background(255);stroke(0);fill(175);ellipse(position.x,position.y,diameter,diameter);}