void setup() {
size(400, 400);
}
void mousePressed(){
millis();
fill(252, 255, 132);
quad(-100, sin(frameCount)/1.5+200, mouseX-110, sin(frameCount)/1.5+200, mouseX-110, sin(frameCount)/1.5+180,-100,sin(frameCount)/1.5+170 );
}
void draw() {
//Sky
background(100, 170, 255);
fill(50, 0, 137,mouseY-100);
rect(0,0,400,400);
noStroke();
//Sun
fill(252, 255, 132);
ellipse(300,mouseY,80,80);
//Moon
fill(255);
ellipse(100,400-mouseY,80,80);
//Road
fill(0);
rect(0,200,400,50);
fill(214, 189, 141, 300-mouseY);
rect(0,200,400,50);
//Far Hills
fill(0);
triangle(280,200,330,160,400,200);
triangle(170,200,220,170,270,200);
triangle(50,200,80,150,140,200);
triangle(10,200,30,170,50,200);
fill(183, 159, 111, 200-mouseY);
triangle(10,200,30,170,50,200);
triangle(50,200,80,150,140,200);
triangle(170,200,220,170,270,200);
triangle(280,200,330,160,400,200);
//Dust
fill(239, 192, 134, 250-mouseY);
ellipse(mouseX+80,211,75-mouseX*0.4,75-mouseX*0.4);
ellipse(mouseX+150,200,90-mouseX*0.3,90-mouseX*0.3);
ellipse(mouseX+125,202,80-mouseX*0.3,80-mouseX*0.3);
ellipse(mouseX+120,210,90-mouseX*0.2,90-mouseX*0.2);
ellipse(mouseX+100,206,90-mouseX*0.1,90-mouseX*0.1);
ellipse(mouseX+230,190,90-mouseX*0.4,90-mouseX*0.4);
ellipse(mouseX+200,170,90-mouseX*0.4,90-mouseX*0.4);
ellipse(mouseX+250,170,90-mouseX*0.4,90-mouseX*0.4);
//-------Night Car Body-------//
//Rear SlottedWindow/Triangles
fill(0);
triangle(mouseX+40, sin(frameCount)/1.5+170, mouseX+60, sin(frameCount)/1.5+160, mouseX+60, sin(frameCount)/1.5+170);
triangle(mouseX+50, sin(frameCount)/1.5+170, mouseX+70, sin(frameCount)/1.5+165, mouseX+70, sin(frameCount)/1.5+170);
//Front Triangle/Headlight
triangle(mouseX-110, sin(frameCount)/1.5+200, mouseX-90, sin(frameCount)/1.5+190, mouseX-110, sin(frameCount)/1.5+180 );
//Front Triangle/Hood
triangle(mouseX-110, sin(frameCount)/1.5+200, mouseX-10, sin(frameCount)/1.5+160, mouseX-10, sin(frameCount)/1.5+200);
//Middle Rectangle/Cab
rect(mouseX-10, sin(frameCount)/1.5+160, 50, 40);
//Rear Quad/Cab
quad(mouseX+40, sin(frameCount)/1.5+160, mouseX+70, sin(frameCount)/1.5+170, mouseX+70, sin(frameCount)/1.5+190, mouseX+40, sin(frameCount)/1.5+200);
//Rear Rectangle/Trunk
quad(mouseX+70, sin(frameCount)/1.5+170, mouseX+100, sin(frameCount)/1.5+170, mouseX+100, sin(frameCount)/1.5+190, mouseX+70, sin(frameCount)/1.5+200);
//Bottom Triangle/Underside
triangle(mouseX-110, sin(frameCount)/1.5+200, mouseX+70, sin(frameCount)/1.5+200, mouseX-100, sin(frameCount)/1.5+210);
//Top Bezier/BodyLine
bezier(mouseX-110, sin(frameCount)/1.5+200, mouseX-30, sin(frameCount)/1.5+160, mouseX+40, sin(frameCount)/1.5+170, mouseX+100, sin(frameCount)/1.5+170);
//-------Day Car Body-------//
//Fading Fill/Colour
fill(255,255,255,300-mouseY);
//Rear SlottedWindow/Triangles
triangle(mouseX+40, sin(frameCount)/1.5+170, mouseX+60, sin(frameCount)/1.5+160, mouseX+60, sin(frameCount)/1.5+170);
triangle(mouseX+50, sin(frameCount)/1.5+170, mouseX+70, sin(frameCount)/1.5+165, mouseX+70, sin(frameCount)/1.5+170);
//Front Triangle/Headlight
triangle(mouseX-110, sin(frameCount)/1.5+200, mouseX-90, sin(frameCount)/1.5+190, mouseX-110, sin(frameCount)/1.5+180 );
//Front Triangle/Hood
triangle(mouseX-110, sin(frameCount)/1.5+200, mouseX-10, sin(frameCount)/1.5+160, mouseX-10, sin(frameCount)/1.5+200);
//Middle Rectangle/Cab
rect(mouseX-10, sin(frameCount)/1.5+160, 50, 40);
//Rear Quad/Cab
quad(mouseX+40, sin(frameCount)/1.5+160, mouseX+70, sin(frameCount)/1.5+170, mouseX+70, sin(frameCount)/1.5+190, mouseX+40, sin(frameCount)/1.5+200);
//Rear Rectangle/Trunk
quad(mouseX+70, sin(frameCount)/1.5+170, mouseX+100, sin(frameCount)/1.5+170, mouseX+100, sin(frameCount)/1.5+190, mouseX+70, sin(frameCount)/1.5+200);
//Bottom Triangle/Underside
triangle(mouseX-110, sin(frameCount)/1.5+200, mouseX+70, sin(frameCount)/1.5+200, mouseX-100, sin(frameCount)/1.5+210);
//Top Bezier/BodyLine
bezier(mouseX-110, sin(frameCount)/1.5+200, mouseX-30, sin(frameCount)/1.5+160, mouseX+40, sin(frameCount)/1.5+170, mouseX+100, sin(frameCount)/1.5+170);
//BodyLineShadow/Quad
fill(235,235,235,300-mouseY);
quad(mouseX-110, sin(frameCount)/1.5+200, mouseX+100, sin(frameCount)/1.5+170, mouseX+100, sin(frameCount)/1.5+190, mouseX-100, sin(frameCount)/1.5+210 );
//Front Wheel Well
fill(20);
bezier(mouseX-85, sin(frameCount)/1.5+209, mouseX-85, sin(frameCount)/1.5+175, mouseX-35, sin(frameCount)/1.5+175, mouseX-35, sin(frameCount)/1.5+207);
//Rear Wheel Well
bezier(mouseX+35, sin(frameCount)/1.5+203, mouseX+35, sin(frameCount)/1.5+172, mouseX+85, sin(frameCount)/1.5+172, mouseX+85, sin(frameCount)/1.5+201);
//Front Wheel
fill(50);
ellipse(mouseX-60, sin(mouseX*50)*1.5+208, 40, 40);
//Rear Wheel
ellipse(mouseX+60, sin(mouseX*50+10)*1.5+207, 42, 42);
//Front Rim
fill(100);
ellipse(mouseX-60, sin(mouseX*50)*1.5+208, 30, 30);
//Reare Rim
ellipse(mouseX+60, sin(mouseX*50+10)*1.5+207, 30, 30);
//Rear Rim Shine
fill(255, sin(mouseX/10)*200+180);
quad(mouseX+59, sin(mouseX*50+10)*1.5+211, mouseX+61, sin(mouseX*50+10)*1.5+211, mouseX+62, sin(mouseX*50+10)*1.5+221, mouseX+58, sin(mouseX*50+10)*1.5+221);
fill(255, sin(mouseX/10-5)*100+180);
quad(mouseX+64, sin(mouseX*50+10)*1.5+206, mouseX+74, sin(mouseX*50+10)*1.5+206, mouseX+74, sin(mouseX*50+10)*1.5+209, mouseX+64, sin(mouseX*50+10)*1.5+208);
fill(255, sin(mouseX/10+5)*100+810);
quad(mouseX+46, sin(mouseX*50+10)*1.5+205, mouseX+56, sin(mouseX*50+10)*1.5+206, mouseX+56, sin(mouseX*50+10)*1.5+208, mouseX+46, sin(mouseX*50+10)*1.5+209);
fill(255, sin(mouseX/10+2.5)*50+180);
quad(mouseX+58, sin(mouseX*50+10)*1.5+194, mouseX+62, sin(mouseX*50+10)*1.5+194, mouseX+61, sin(mouseX*50+10)*1.5+204, mouseX+59, sin(mouseX*50+10)*1.5+204);
//Front Rim Shine
fill(255, sin(mouseX/10+5)*200+180);
quad(mouseX-61, sin(mouseX*50)*1.5+211, mouseX-59, sin(mouseX*50)*1.5+211, mouseX-58, sin(mouseX*50)*1.5+221, mouseX-62, sin(mouseX*50)*1.5+221);
fill(255, sin(mouseX/10-5+5)*100+180);
quad(mouseX-56, sin(mouseX*50)*1.5+206, mouseX-46, sin(mouseX*50)*1.5+206, mouseX-46, sin(mouseX*50)*1.5+209, mouseX-56, sin(mouseX*50)*1.5+208);
fill(255, sin(mouseX/10+5+5)*100+180);
quad(mouseX-74, sin(mouseX*50)*1.5+205, mouseX-64, sin(mouseX*50)*1.5+206, mouseX-64, sin(mouseX*50)*1.5+208, mouseX-73, sin(mouseX*50)*1.5+209);
fill(255, sin(mouseX/10+2.5+5)*50+180);
quad(mouseX-62, sin(mouseX*50)*1.5+194, mouseX-58, sin(mouseX*50)*1.5+194, mouseX-59, sin(mouseX*50)*1.5+204, mouseX-61, sin(mouseX*50)*1.5+204);
//Front Windsheild/Bezier
fill(0);
bezier(mouseX-13, sin(frameCount)/1.5+162, mouseX+50, sin(frameCount)/1.5+162, mouseX+30, sin(frameCount)/1.5+180, mouseX-60,sin(frameCount)/1.5+180);
//A-Pillar/Quad
fill(255,255,255,300-mouseY);
quad(mouseX, sin(frameCount)/1.5+160, mouseX+2, sin(frameCount)/1.5+162, mouseX-25, sin(frameCount)/1.5+180, mouseX-30, sin(frameCount)/1.5+180);
//Cab Spoiler/Quad
fill(0);
quad(mouseX+40, sin(frameCount)/1.5+155, mouseX+50, sin(frameCount)/1.5+155, mouseX+50, sin(frameCount)/1.5+170, mouseX+30, sin(frameCount)/1.5+170);
//Rear Triangle/Spoiler
triangle(mouseX+80, sin(frameCount)/1.5+180, mouseX+105, sin(frameCount)/1.5+160, mouseX+95, sin(frameCount)/1.5+180);
//-------End Of Car Body-------//
//Nighttime EdgeLighting
stroke(255,255,255,mouseY-100);
line(mouseX-90, sin(frameCount)/1.5+190,mouseX-10, sin(frameCount)/1.5+160);
line(mouseX-10, sin(frameCount)/1.5+160,mouseX+35, sin(frameCount)/1.5+160);
line(mouseX-90, sin(frameCount)/1.5+190,mouseX-110, sin(frameCount)/1.5+180);
line(mouseX+40, sin(frameCount)/1.5+155, mouseX+50, sin(frameCount)/1.5+155);
line(mouseX+80, sin(frameCount)/1.5+180, mouseX+105, sin(frameCount)/1.5+160);
line(mouseX+50, sin(frameCount)/1.5+165, mouseX+60, sin(frameCount)/1.5+160);
line(mouseX+60, sin(frameCount)/1.5+168, mouseX+70, sin(frameCount)/1.5+165);
line(mouseX+40, sin(frameCount)/1.5+155,mouseX+30, sin(frameCount)/1.5+170);
line(mouseX+70,sin(frameCount)/1.5+170 ,mouseX+91, sin(frameCount)/1.5+170);
noStroke();
//Foreground
fill(224, 213, 168);
rect(0,250,400,200);
fill(0,0,0, mouseY-100);
rect(0,250,400,200);
}