Hello,
I’m new to processing and I need help with my code. How can I switch my background to another colour when I click something on my mouse? And How can I code the sun to move?
void setup()
{
size(800,600);
background(#7DD1E5,20);
}
void draw()
{
fill(#E5CB00,100);
stroke(#FFF41A,50);
ellipse(50, 100, 100, 100);
fill(#FFF41A,50);
ellipse(50, 100, 60, 60);
ellipse(50, 100, 55, 55);
ellipse(50, 100, 50, 50);
ellipse(50, 100, 45, 45);
ellipse(50, 100, 40, 40);
ellipse(50, 100, 35, 35);
ellipse(50, 100, 30, 30);
fill(#FFFFFF,50);
noStroke();
circle(100, 150, 50);
circle(70, 150, 50);
circle(130, 150,50);
circle(160, 150,50);
circle(85, 120,50);
circle(115, 120,50);
circle(145, 120,50);
circle(365, 250, 50);
circle(335, 250, 50);
circle(395, 250, 50);
circle(425, 250, 50);
circle(350, 220, 50);
circle(380, 220, 50);
circle(410, 220, 50);
circle(650, 100, 50);
circle(620, 100, 50);
circle(680, 100, 50);
circle(710, 100, 50);
circle(635, 70, 50);
circle(665, 70, 50);
circle(695, 70, 50);
stroke(5); // Haus
strokeWeight(5);
fill(#E54C57);
square(25,325,250);
strokeWeight(2);
fill(#8B4513);
rect(100,430,100,145);
strokeWeight(1);
fill(#CD853F);
rect(140,430,20,145);
rect(100,480,100,20);
noStroke();
fill(#585A57);
rect(175,485,20,10);
fill(#111112);
rect(200,200,50,125);
stroke(0);
strokeWeight(3);
fill(#CD853F);
triangle(10,325,150,200,290,325);
stroke(50);
strokeWeight(5);
fill(#857F86,200);
rect(-5,575,70,70);
rect(67,575,70,70);
rect(137,575,70,70);
rect(207,575,70,70);
rect(277,575,70,70);
rect(347,575,70,70);
rect(417,575,70,70);
rect(487,575,70,70);
rect(557,575,70,70);
rect(627,575,70,70);
rect(697,575,70,70);
rect(767,575,70,70);
}