int x = 0;
int speed = 1;
int circleSize = 100;
void setup(){
size(600, 600);
}
void draw(){
background(216, 245, 7);
ellipse(x, 200, circleSize, circleSize);
if(x < 300){
fill(250, 5, 226);
}
else if(x > 300){
fill(12, 159, 247);
}
if(mousePressed && mouseX > width/2){
background(245, 178, 7);
}
if(x > width/2){
circleSize = circleSize – 1;
}
else if(x < width/2){
circleSize = circleSize + 1;
}
if(keyPressed){
triangle(300, 100, 250, 200, 350, 200);
}
if(keyPressed){
fill(108, 12, 193);
}
if(x == width){
speed = speed* -1;
}
else if(x < 0){
speed = speed* -1;
}
x = x + speed;
}