Sourch code
:
//mode
continuos
void setup()
{
size(400,200);
}
void draw()
{
background(205,222,0);
int d;
d=second();
//pemandangan
fill(50,20,210);
rect(0-d*10,0,1000,100);
//jalan
fill(5);
rect(0-d*10,100,1000,50);
//line
fill(255);
rect(-d+20-d*5,125,37,2);
fill(255);
rect(-d+90-d*5,125,37,2);
fill(255);
rect(-d+160-d*5,125,37,2);
fill(255);
rect(-d+230-d*5,125,37,2);
fill(255);
rect(-d+300-d*5,125,37,2);
fill(255);
rect(-d+370-d*5,125,37,2);
fill(255);
rect(-d+440-d*5,125,37,2);
fill(250);
rect(-d+510-d*5,125,37,2);
fill(250);
rect(-d+580-d*5,125,37,2);
fill(250);
rect(-d+650-d*5,125,37,2);
fill(250);
rect(-d+720-d*5,125,37,2);
fill(250);
rect(-d+790-d*5,125,37,2);
fill(255);
rect(-d+860-d*5,125,37,2);
fill(255);
rect(-d+930-d*5,125,37,2);
fill(250);
rect(-d+1000-d*5,125,37,2);
fill(250);
rect(-d+1070-d*5,125,37,2);
fill(250);
rect(-d+1140-d*5,125,37,2);
fill(250);
rect(-d+1220-d*5,125,37,2);
//tower
fill(5);
rect(390-d*2,50,2,50);
rect(381-d*2,50,20,15);
fill(255,255,0);
ellipse(390-d*2,58,5,5);
fill(5);
rect(590-d*2,50,2,50);
fill(5);
rect(581-d*2,50,20,15);
//mobil1
fill(200,60,50);
rect(100,75,75,40);
//cendela
fill(255,255,0);
rect(160,85,8,5);
fill(255,255,0);
rect(143,85,8,5);
fill(255,255,0);
rect(125,85,8,5);
fill(255,255,0);
rect(105,85,8,5);
fill(55,255,160);
ellipse(110,115,15,15);
fill(150,160,145);
rect(100,100,75,1);
beginShape(POLYGON);
fill(150,160,145);
vertex(175,76);
vertex(181,76);
vertex(189,108);
vertex(189,115);
vertex(175,115);
endShape();
fill(55,255,160);
ellipse(170,115,15,15);
//bulan
fill(255,255,0);
ellipse(-d+370-d*0.01,20,30,30);
//cendelakepala
fill(255,255,0);
rect(175.5,92,8,5);
//mobil2
fill(5,190,205);
rect(-d+250-d*5,100,100,40);
//kepala
mobil2
beginShape(POLYGON);
fill(250,160,0);
vertex(-d+250-d*5,115);
vertex(-d+235-d*5,115);
vertex(-d+220-d*5,130);
vertex(-d+220-d*5,140);
vertex(-d+250-d*5,140);
endShape();
//roda mobil2
fill(155,100,50);
ellipse(-d+340-d*5,140,15,15);
fill(155,100,50);
ellipse(-d+270-d*5,140,15,15);
fill(155,100,50);
ellipse(-d+235-d*5,140,15,15);
//seret
fill(255,0,0);
rect(-d+250-d*5,100,100,2);
fill(0,255,0);
rect(-d+250-d*5,105,100,2);
fill(0,0,255);
rect(-d+250-d*5,110,100,2);
fill(255,0,0);
rect(-d+250-d*5,115,100,2);
fill(0,255,0);
rect(-d+250-d*5,120,100,2);
fill(0,0,255);
rect(-d+250-d*5,125,100,2);
fill(255);
rect(-d+250-d*5,130,100,2);
fill(255);
rect(-d+280-d*5,135,50,2);
}
Outputnya :