int x = 300;
int speed = 10;
void setup() {
size (600, 600);
}
void draw() {
background(0);
stroke(0, 255, 0);
fill(0, 0, 255);
ellipse(x, x, 100, 100);
if (x > width) {
speed = speed * -1;
}
else if (x < 0) {
speed = speed * -1;
}
x = x+speed;
}
void mousePressed(){
background(0,0,255);
}