xxxxxxxxxx
143
//Beach Night-- 2021 Kar Rosen//karthonic
//This was created for the BMCC Makerspace's p5.js guide to help get a better handle of the programming language. Feel free to make a copy and play around!
//I have left all the diffent ways to make a moon up so all you have to do is unqoute as you go; highlight what you want and hit ctrl/cmd + / to unquote items in the code. Enjoy!
function setup() {
createCanvas(400, 400);
background(10, 10, 100);
}
function draw() {
//Crescent Moon
fill(225, 225, 225);
noStroke();
ellipse(300, 100, 125, 125);
fill(10, 10, 100);
noStroke();
ellipse(275, 100, 125, 125);
// //Cresent Moon 2
// fill(225, 225, 225);
// noStroke ();
// arc(300,100, 125, 125, PI+HALF_PI, HALF_PI, CHORD);
// fill(10, 10, 100);
// noStroke();
// ellipse(290, 100, 125, 125);
// //Half Moon
// fill(225, 225, 225);
// noStroke ();
// arc(300,100, 125, 125, PI+HALF_PI, HALF_PI, CHORD);
// //Full Moon
// fill(225,225,225);
// noStroke();
// ellipse(300, 100, 125);
//Island
fill(158, 147, 74);
arc(150, 275, 250, 175, PI, TWO_PI);
//Wave 1
noFill();
stroke(14, 109, 181);
strokeWeight(45);
beginShape();
vertex(0, 280);
bezierVertex(100, 300, 175, 220, 400, 300);
endShape();
//Wave 2
noFill();
stroke(0, 83, 138);
strokeWeight(15);
beginShape();
vertex(0, 280);
bezierVertex(175, 325, 150, 200, 400, 310);
endShape();
//Wave 3
noFill();
stroke(255);
strokeWeight(10);
beginShape();
vertex(0, 300);
bezierVertex(200, 325, 175, 240, 410, 325);
endShape();
//Wave 4
noFill();
stroke(0, 42, 105);
strokeWeight(20);
beginShape();
vertex(0, 315);
bezierVertex(100, 340, 260, 275, 410, 340);
endShape();
//Shark
fill(150);
stroke(130);
strokeWeight(10);
arc(150, 350, 150, 150, PI, PI + HALF_PI, PIE);
//Wave 5
noFill();
stroke(14, 109, 181);
strokeWeight(20);
beginShape();
vertex(0, 340);
bezierVertex(100, 370, 175, 300, 410, 360);
endShape();
//Wave 6
noFill();
stroke(0, 42, 105);
strokeWeight(25);
beginShape();
vertex(0, 365);
bezierVertex(150, 375, 260, 330, 410, 390);
endShape();
//Wave 7
noFill();
stroke(255);
strokeWeight(8);
beginShape();
vertex(0, 350);
bezierVertex(100, 390, 275, 300, 410, 380);
endShape();
//Wave 8
noFill();
stroke(0, 83, 138);
strokeWeight(25);
beginShape();
vertex(0, 385);
bezierVertex(190, 395, 250, 360, 410, 395);
endShape();
//Wave 9
noFill();
stroke(14, 109, 181);
strokeWeight(15);
beginShape();
vertex(0, 390);
bezierVertex(175, 410, 210, 375, 410, 400);
endShape();
//Stars
fill(255);
noStroke();
ellipse(50, 50, 5, 5);
ellipse(125, 90, 5, 5);
ellipse(200, 25, 5, 5);
ellipse(225, 100, 5, 5);
ellipse(30, 150, 5, 5);
ellipse(175, 150, 5, 5);
ellipse(350, 200, 5, 5);
}