xxxxxxxxxx
//global variable space
var angle;
let circleY;
function setup() {
createCanvas(500, 500);
//mode
angleMode(DEGREES)
rectMode(CENTER)
//variables
angle=0;
}
function draw() {
background (0,random(100,150), random(20, 30));
//Sun circle
stroke(153,50,27);
strokeWeight (4);
fill (153,50,27);
ellipse (250,250,150,150);
stroke(255, 131, 0);
strokeWeight (4)
fill (255, 131, 0);
ellipse (250,250,140,115);
//user interaction
if (keyIsPressed)
{
angle++
}
//Boxes in corners
//upper left rectangle
push()
noStroke(0);
fill(76, 50, 14);
translate(40,48);
rotate(angle);
rect(0,0,75);
pop()
//lower right rectangle
push()
noStroke(0);
fill(76, 50, 14);
translate(439,446);
rotate(angle)
rect(0,0,75,75);
pop()
//LOWER LEFT RECTANGLE
push()
noStroke(0);
fill(76, 50, 14);
translate(35,450)
rotate(angle)
rect(0,0,75,75);
pop()
//UPPER RIGHT RECTANGLE
push()
noStroke(0);
fill(76, 50, 14);
translate(450,45)
rotate(angle)
rect(0,0,75,75);
pop()
//triangles by sun
stroke(220, 54, 43);
strokeWeight (4)
fill (216, 180, 37);
triangle (200,100,180,170,260,150);
triangle (90,230,160,280,170,190);
triangle (180,320,220,400,260,340);
triangle (305,325,350,260,395,340);
triangle (290,160,350,230,380,170);
//text
fill(220, 54, 43);
stroke(0);
text("muted sunshine",150,250);
textSize(width/15);
//large x in middle
stroke(244, 203, 133);
line(0,0,500,500);
line(1,0,500,499);
line(2,0,500,498);
line(3,0,500,497);
line(3.5,0,500,496.5);
line(4,0,500,496);
line(500,0,0,500);
line(499,0,0,499);
line(498,0,0,498);
line(1,500,500,1);
line(497,0,497,0);
line(496,0,496,0);
line(2,500,500,2);
//lines from triangles
stroke(76)
strokeWeight(5)
fill(255, 131, 0)
line(220,400,100,500);
line(215,399,99,499);
stroke(255, 131, 0)
line(90,230,0,340);
stroke(220, 54, 43)
line(200,100,0,200);
line(395,340,270,500);
}