xxxxxxxxxx
130
let x = 20;
let y = 80;
let p = 5;
function setup() {
createCanvas(400, 400);
b = random(100, 350);
r = random(100, 180);
g = random(100, 180);
// above code assigns random properties to variables
}
function draw() {
background(r, g, b);
//original background color before flicker is applied
fill(255, 234, 0);
stroke(255, 234, 0);
//sun
circle(200, 170, 150);
// y = random(80, 110);
// brown srip of sand
fill(242, 227, 141);
noStroke();
rect(0, 360, 400, 50);
//Blue strip of water
fill(160, 250, 238);
noStroke();
rect(0, 310, 400, 50);
// Shark fins below
// fill("gray");
// noStroke();
// arc(mouseX, 320, 40, 50, PI + HALF_PI, 0);
// arc(mouseX + 40, 325, 50, 60, PI + HALF_PI, 0);
// arc(mouseX + 80, 320, 40, 50, PI + HALF_PI, 0);
//clouds below
fill("white");
stroke("white");
ellipse(270, 80, 140, 70);
circle(270, 95, 50);
circle(240, 90, 50);
circle(240, 60, 50);
circle(270, 60, 50);
circle(290, 65, 50);
//stem of flag
stroke("white");
rect(260, 280, 5, 100);
// flag
fill("purple");
rect(265, 290, 35, 25);
//color changing/re-generating background
r = random(220, 320);
l = random(120, 300);
rTwo = random(220, 320);
lTwo = random(120, 300);
fill("navy");
stroke("navy");
//rain drops appearing at random points
//circle(r, l, p);
//circle(rTwo, lTwo, p);
//FROG
push();
scale(0.1);
//head. An oval, not a circle because this is a frog.
stroke(0, 230, 0);
noStroke();
fill(152, 255, 140);
ellipse(250, 310, 400, 300);
//eye parts (green)
stroke(0, 230, 0);
strokeWeight(20);
fill(152, 255, 140);
noStroke();
ellipse(140, 160, 160, 160);
ellipse(340, 160, 160, 160);
//eye (whites)
noStroke();
fill(255);
ellipse(140, 150, 110, 110);
ellipse(340, 150, 110, 110);
//eyes (black)
stroke(0);
fill(0);
ellipse(140, 150, 40, 40);
ellipse(350, 150, 40, 40);
// inner eye whites
fill(255);
noStroke();
ellipse(130, 165, 25, 25);
ellipse(360, 135, 25, 25);
//mouth line
stroke(1);
strokeWeight(20);
line(100, 340, 400, 340);
//cover up
fill(152, 255, 140);
noStroke();
rect(210, 250, 130, 80);
fill(255, 92, 92);
arc(290, 350, 100, 150, 0, PI, CHORD);
pop();
}
// when mouse is pressed, rain is stopped
function mousePressed() {
p = 0; // p refers to size of dots, when it is 0, dots are zero sized
}