/*
* Amy Lee
* amyl2
* Section B
*/
var x = 0;
var y = 0;
function setup() {
createCanvas(600,450);
background(10);
}
function draw() {
noStroke();
background((constrain(mouseY,200,210)),(constrain(mouseY,220,240)),constrain(mouseY,190,210));
// - CLOUDS - //
//EllipseX variable is to expand or contract ellipse width
var ellipseWidth = constrain(mouseY,100,150);
//Variables for cloud on left side
var positionY = constrain(mouseY,100,150);
var positionY2 = constrain(mouseY,50,100);
var positionX = constrain(mouseX,80,100);
//Cloud on left side moves side to side
fill(constrain(mouseY,230,255));
ellipse(positionX,positionY,ellipseWidth,100);
ellipse(positionX+50,positionY2,100,100);
ellipse(positionX+100,positionY,100,100);
ellipse(positionX+150,positionY2,100,100);
ellipse(positionX+200,positionY,ellipseWidth,100);
//Variables for cloud on right side
var positionY3 = constrain(mouseY,300,350);
var positionY4 = constrain(mouseY,250,300);
var positionX2 = constrain(mouseX,50,120);
//Cloud on right side moves side to side
fill(constrain(mouseX,200,230));
ellipse(positionX2+200,positionY3,ellipseWidth,100);
ellipse(positionX2+250,positionY4,100,100);
ellipse(positionX2+300,positionY3,100,100);
ellipse(positionX2+350,positionY4,100,100);
ellipse(positionX2+400,positionY3,ellipseWidth,100);
//Yellow circles as stars in the background
push();
rotate(radians(mouseX*2));
fill(252,255,128);
ellipse(100,500,20,20);
ellipse(200,100,20,20);
ellipse(300,500,20,20);
ellipse(400,100,20,20);
ellipse(500,500,20,20);
pop();
push();
rotate(radians(mouseY*2));
fill(252,255,128);
ellipse(100,500,20,20);
ellipse(200,100,20,20);
ellipse(300,500,20,20);
ellipse(400,100,20,20);
ellipse(500,500,20,20);
pop();
//Mountains
fill(148,171,146);
triangle(270,490+mouseY,330,330+mouseY,390,490+mouseY);
triangle(330,490+mouseY,430,330+mouseY,520,490+mouseY);
triangle(0,490+mouseY,200,250+mouseY,400,490+mouseY);
triangle(400,490+mouseY,500,300+mouseY,600,490+mouseY);
//Flower in the center
push();
translate(300,220);
fill(random(195,250),random(155,170),random(25,37));
for (let r = 0; r < 10; r++){
ellipse(0,0,20,80);
rotate(PI/5);
}
pop();
//sun
push();
translate(300,220);
fill(random(195,250),random(155,170),random(25,37));
ellipse(0,90,10,mouseY);
rotate(radians(40));
ellipse(0,90,10,mouseY);
rotate(radians(40));
ellipse(0,90,10,mouseY);
rotate(radians(40));
ellipse(0,90,10,mouseY);
rotate(radians(40));
ellipse(0,90,10,mouseY);
rotate(radians(40));
ellipse(0,90,10,mouseY);
rotate(radians(40));
ellipse(0,90,10,mouseY);
rotate(radians(40));
ellipse(0,90,10,mouseY);
rotate(radians(40));
ellipse(0,90,10,mouseY);
pop();
}
I was inspired by nature and weather. I tried to depict the sun, mountains, stars, and clouds in my piece.