xxxxxxxxxx
152
//Beach Scene -- 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!
function setup() {
createCanvas(400, 400);
}
function draw() {
background(0, 204, 255);
//Sun
fill(255, 204, 0);
noStroke();
ellipse(300, 100, 125, 125);
fill(255, 153, 0);
noStroke();
ellipse(300, 100, 100, 100);
fill(255, 255, 102);
noStroke();
ellipse(300, 100, 80, 80);
//Island
fill(255, 255, 200);
arc(150, 275, 250, 175, PI, TWO_PI);
//Wave 1
noFill();
stroke(102, 255, 255);
strokeWeight(45);
beginShape();
vertex(0, 280);
bezierVertex(100, 300, 175, 220, 400, 300);
endShape();
//Wave 2
noFill();
stroke(0, 153, 255);
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, 102, 255);
strokeWeight(20);
beginShape();
vertex(0, 315);
bezierVertex(100, 340, 260, 275, 410, 340);
endShape();
//Shark
fill(216);
stroke(210);
strokeWeight(10);
arc(150, 350, 150, 150, PI, PI + HALF_PI, PIE);
//Wave 5
noFill();
stroke(102, 255, 255);
strokeWeight(18);
beginShape();
vertex(0, 340);
bezierVertex(100, 370, 175, 300, 410, 360);
endShape();
//Wave 6
noFill();
stroke(0, 102, 255);
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, 153, 255);
strokeWeight(25);
beginShape();
vertex(0, 385);
bezierVertex(190, 395, 250, 360, 410, 395);
endShape();
//Wave 9
noFill();
stroke(102, 255, 255);
strokeWeight(15);
beginShape();
vertex(0, 390);
bezierVertex(175, 410, 210, 375, 410, 400);
endShape();
//Seagull 1
noFill();
stroke(255);
strokeWeight(4);
beginShape();
vertex(50, 25);
bezierVertex(50, 35, 57.5, 65, 65, 25);
endShape();
//Seagull 2
noFill();
stroke(255);
strokeWeight(4);
beginShape();
vertex(320, 215);
bezierVertex(320, 225, 327.5, 240, 335, 215);
endShape();
//Cloud
fill(255);
noStroke();
ellipse(130, 100, 50, 50);
fill(255);
noStroke();
ellipse(100, 110, 50, 50);
fill(255);
noStroke();
ellipse(160, 110, 50, 50);
fill(255);
noStroke();
ellipse(130, 115, 50, 50);
}