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