// Dartmouth CS 2, Winter 2009, Chris Bailey-Kellogg // Notes 4 | Sketch 8 // The current coordinates of the ball, starting at the center float x=50, y=50; void setup() { size(400,400); smooth(); noStroke(); background(0); } void draw() { fill(0,3); rect(0,0,width,height); fill(255); ellipse(x,y,5,5); // Move the position by random steps in x and y x = x+random(-2,2); y = y+random(-2,2); } void mousePressed() { x = mouseX; y = mouseY; }