xxxxxxxxxx
int x=50;
int y=50;
void setup() {
size(400,400);
}
boolean backgroundisPURPLE= false;
void draw() {
if (backgroundisPURPLE ==true){
background(58,67,153); //PURPLE
ellipse (x+50,y+50,30,30);
x= x+5;
ellipse (x+100,y+50,50,50);
x= x+5;
ellipse (x,y+50,50,50);
y= y+5;
}else{
background(241,249,0); //YELLOW
fill(0,255,33);
if ((mouseX>width/2)&&(mouseY<height/2))
ellipse(width/2+width/4,height/4,100,100);
fill(255,255,255);
if((mouseX>width/2)&&(mouseY>height/2))
ellipse(width/2+width/4,height/2+height/4,100,100);
ellipse (x,y,20,20);
x= x+2;
} }
void mousePressed (){
if (backgroundisPURPLE == true){
backgroundisPURPLE = false;
} else {
backgroundisPURPLE = true;
}
}
void mouseDragged(){
fill(232,9,12);
ellipse (x+50,y-10,100,100);
}