xxxxxxxxxx
let s = 0;
let timer = 0;
let cr = 0;
let cl = 0;
let cu = 0;
function setup() {
createCanvas(500,500);
}
function mousePressed(){
print ("mouseX=", mouseX, "mouseY=", mouseY);
}
function draw() {
background(0,170,220);
background(0,0,220,mouseY);
//boat
fill (255);
rect (mouseX+10,60,50,20);
//cars
//shark
//noStroke();
fill(0,0,100,30)
beginShape();
vertex(s+370,42);
vertex(s+380,32);
vertex(s+400,27);
vertex(s+420,30);
vertex(s+423,25);
vertex(s+435,10);
vertex(s+430,23);
vertex(s+430,30);
vertex(s+448,31.5);
vertex(s+458,33);
vertex(s+467,27);
vertex(s+465,34);
vertex(s+485,38);
vertex(s+500,25);
vertex(s+492,40);
vertex(s+500,52);
vertex(s+484,42);
vertex(s+465,46);
vertex(s+467,52);
vertex(s+457,46);
vertex(s+448,48);
vertex(s+430,51);
vertex(s+430,57);
vertex(s+434,71);
vertex(s+420,54);
vertex(s+400,57);
vertex(s+380,52);
endShape(CLOSE);
fill(100)
beginShape();
vertex(s+417,41);
vertex(s+420,40);
vertex(s+440,40);
vertex(s+440,42);
vertex(s+420,42);
endShape(CLOSE);
s = s - .5;
timer = timer + 1;
//outline thing
fill(210);
beginShape();
vertex(220,0);
vertex(220,120);
vertex(170,100);
vertex(0,100);
vertex(0,500);
vertex(500,500);
vertex(500,100);
vertex(330,100);
vertex(280,120,);
vertex(280,0);
endShape (CLOSE);
//roads
fill(120)
beginShape();
vertex(0,240);
vertex(0,215);
vertex(500,215);
vertex(500,240);
endShape(CLOSE);
beginShape();
vertex(0,210);
vertex(0,200);
vertex(500,200);
vertex(500,210);
endShape(CLOSE);
fill(120)
beginShape();
vertex(230,0);
vertex(230,200);
vertex(270,200);
vertex(270,0);
endShape(CLOSE);
fill(240)
triangle(250,145,260,200,240,200);
fill(120);
beginShape();
vertex(270,145);
vertex(290,200);
vertex(270,200);
endShape(CLOSE);
fill(120);
triangle(230,145,210,200,230,200);
fill(120)
beginShape();
vertex(0,195);
vertex(0,180);
vertex(190,180);
vertex(190,195);
endShape(CLOSE);
fill(120)
beginShape();
vertex(310,195);
vertex(500,195);
vertex(500,180);
vertex(310,180);
endShape(CLOSE);
//grass
fill(0,78,56);
beginShape();
vertex(0,450);
vertex(200,450);
vertex(200,245);
vertex(0,245);
endShape(CLOSE);
fill(0,78,56);
beginShape();
vertex(500,450);
vertex(500,245);
vertex(300,245);
vertex(300,450);
endShape(CLOSE);
//ledge thing
noStroke();
fill(150);
beginShape();
vertex(0,470);
vertex(0,500);
vertex(500,500);
vertex(500,470);
endShape(CLOSE);
fill(170);
beginShape();
vertex(0,470);
vertex(500,470);
vertex(500,450);
vertex(0,450);
endShape(CLOSE);
//tower legs
fill(100);
beginShape();
vertex(210,450)
vertex(170,400)
vertex(170,450);
endShape(CLOSE);
fill(80);
beginShape();
vertex(210,450);
vertex(170,400);
vertex(250,400);
vertex(250,450);
endShape(CLOSE);
fill(80);
beginShape();
vertex(250,400);
vertex(250,450);
vertex(290,450);
vertex(330,400);
endShape(CLOSE);
fill(100);
beginShape();
vertex(290,450);
vertex(330,400);
vertex(330,450);
endShape(CLOSE);
fill(210);
beginShape();
vertex(210,400);
vertex(290,400);
vertex(270,420);
vertex(230,420);
endShape(CLOSE);
fill(70)
beginShape();
vertex(170,400);
vertex(136,367);
vertex(176,367);
vertex(210,400);
endShape(CLOSE);
fill(90)
beginShape();
vertex(170,450);
vertex(170,400);
vertex(137,367);
vertex(137,390);
endShape(CLOSE);
fill(70)
beginShape();
vertex(290,400);
vertex(330,400);
vertex(364,367);
vertex(324,367);
endShape(CLOSE);
fill(90)
beginShape();
vertex(330,450);
vertex(330,400);
vertex(360,370);
vertex(360,390);
endShape(CLOSE);
fill(70)
beginShape();
vertex(198,390);
vertex(230,400);
vertex(270,400);
vertex(302,390);
vertex(270,405);
vertex(230,405);
endShape(CLOSE);
//cars
fill (255,0,0);
rect (cr+10,220,15,5);
fill (0);
rect (cr+90,220,15,5);
fill (0,0,153);
rect (cl+470,230,15,5);
fill (0,60,153);
rect (cl+670,230,15,5);
fill (0,60,153);
rect (260,cu+128,5,15);
cr = cr + 1;
timer = timer + 1;
cl = cl - 1;
timer = timer + 1;
cu = cu - 1;
timer = timer + 1;
}