123

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              // setup() executes only once and at the very beginning
function setup() {
  createCanvas(800, 500);
  
 
}
// draw() executes over and over once setup() has executed
function draw() {
   background(136,204,215);
 //line(120,40,160,70);
 //bezier(120,40,10,90,180,160,140,200);
 
  noStroke();
  //mountain
 fill(115,144,157);
 arc(220,380,180,250,PI,PI,CHORD);
  
 
  //road
  stroke(107,94,107);
  strokeWeight(10)
  line(0,385,500,385);
  stroke(66,58,66);
  strokeWeight(10);
  line(0,390,500,390);
  //road-bank
  noStroke();
  fill(107,94,107);
  rect(0,390,500,800);
  //river
     fill(44,164,184);
  rect(0,430,500,800);
  fill(37,116,168);
  rect(0,445,500,800);
  //tree-near-left-house
   noStroke();
  fill(154,190,99);
  rect(50,360,40,20,20);
 
  rect(50,340,40,20,20);
  
 
  
  
  //house-left
   c=color(127,115,118);//dark grey
  b=color(150,140,136);//light grey
  fill(b);
  rect(0,320,60,60);//button
  rect(0,295,60,20);//2nd layer from top to buttom
  fill(c);
  quad(0,265,50,265,60,295,0,295);//top
  rect(0,310,60,15);//3nd layer from top to buttom
  fill(99,93,90);
  rect(30,335,20,20);//window
  
   //tree-near-right house
     noStroke();
  fill(154,190,99);
  rect(350,300,80,20,20);
  rect(355,285,60,20,20);
  ellipse(380,288,30,30);
  
  
   //house-right
  fill(c);
  quad(390,245,470,245,480,265,380,265);//roof
  fill(118,158,172);
  rect(380,265,100,115);
  fill(99,93,90);
  rect(450,275,20,20);//window
  fill(148,103,77);
  rect(400,320,100,60);//object
  fill(132,96,73,150);
  triangle(400,320,470,380,359,380);//shadow
 //cloud 1-left
  fill(255);
  noStroke();
  rect(0,80,120,30,20);//buttom
  rect(0,50,80,40,30);//middle
  ellipse(40,50,40,40);//top
  
   //cloud 2-middle
  rect(200,60,120,30,20);//buttom
  ellipse(240,52,40,40,30);//middle
  ellipse(270,60,40,40);//top
  
    //cloud 3-middle
  rect(400,160,120,30,20);//buttom
  rect(420,135,140,30,30);//middle
  ellipse(460,130,40,40);//top
  ellipse(485,130,20,20);//top
  
  
   //tree-near-tower
     noStroke();
  fill(154,190,99);
  rect(210,360,60,20,20);
  rect(215,345,60,20,20);
  ellipse(240,343,20,20);
  
 
  
  //tower
  a=color(132,96,73);//dark-coffee
  d=color(148,103,77);//light-cofee
  fill(d);
  rect(250,220,60,160);//body
  fill(71,62,83);
  rect(245,215,70,5);//body-roof
  fill(120,83,68,100);
  triangle(250,220,310,220,310,280);//body-shadow
  fill(d);
  rect(240,235,80,65);//clock-body
  fill(71,62,83);
  rect(235,235,90,5);//clock-roof
  
   //colck-tower
   fill(239,220,174);
  ellipse(280,270,45,45);//outside
  fill(0);
  ellipse(280,270,8,8);//outside
  
  fill(120,83,68,100);
  triangle(240,240,320,240,320,300);//body-shadow
  
  //3nd-buttom-shadow
  fill(120,83,68,100);
  triangle(250,300,310,300,310,380);//body-shadow
  
  //holder
  fill(89,86,105);
  quad(265,195,300,195,310,215,255,215);//whole
  fill(81,77,98);
  quad(282,200,300,200,310,215,282,215);//shadow
  
  //tip-buttom
  fill(178,135,89);
  rect(265,184,35,15);
  fill(200,166,101);
  triangle(265,184,275,199,265,199);//shadow
  
  //tip-buttom's top

  fill(73,62,81);
   rect(264,179,36,5);
  
  //tower-top
   fill(89,86,105);
  triangle(265,179,279,120,299,179);
  fill(83,79,99);
  triangle(280,179,279,120,299,179);//shadow
 fill(152,114,87);
  rect(277.5,110,3,15);//tip
  
  
  
//Red-bus
  fill(216,54,73);
  rect(280,310,120,30,15,15,0,0);//bus-top-level
  fill(136,175,191);
  rect(288,320,105,10,15,15,0,0);//top-window
 
  // fill(112,144,157);
  //rect(280,310,120,15)
 
  fill(216,54,73);
//  noStroke();
  rect(280,345,120,30);//bus-buttom-level
  fill(136,175,191);
  rect(288,350,105,10);//bus-buttom-level-window
  rect(288,360,10,10);//bus-buttom-buttom-level-window
  
  fill(49,69,69);//grey
  rect(280,340,120,5);//bus-middle-level
  
  ellipse(330,375,15,15);//tire-left
  fill(101,88,102);
  ellipse(330,375,8,8);//inter-tire
  fill(49,69,69);
  ellipse(370,375,15,15);//tire-right
  fill(101,88,102);
  ellipse(370,375,8,8);//inter-tire-right
  
  
  stroke(91,112,127);
  for(i=0; i<=4; i++){ line(298+i*20,324,298+i*20,327);
  }//window's frame
  
  for(i=0; i<=4; i++){ line(298+i*20,354,298+i*20,357);
  }
    
  //fill(132,96,73); 
  //triangle(375,370,385,375,375,375);//shadow
  
  println("mouseX= "+mouseX+ " mouseY="+mouseY); 
  function keyPressed(){
  }
  function mousePressed(){
  }
  
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console