xxxxxxxxxx
171
let a = 150;
let b = 260;
let c = 280;
let r = 40;
let p = 156;
let m = 167;
let n = 182;
let o = 132.5;
let x = 0;
let z = 0;
function setup() {
createCanvas(400, 400);
background(220);
angleMode(DEGREES);
}
function draw() {
// z=z+10;
// background(220);
strokeWeight(3);
push();
blendMode(LIGHTEST);
stroke(215, 200, 10);
translate(width / 2, height / 2);
rotate(z);
line(0, -600, 0, 600);
z = z - 1;
pop();
push();
blendMode(MULTIPLY);
stroke(215, 200, 10);
translate(width / 2, height / 2);
rotate(x);
line(0, -600, 0, 600);
x += 1;
pop();
push();
blendMode(LIGHTEST);
stroke(215, 200, 10);
translate(width / 2, height / 2);
rotate(z + 45);
line(0, -600, 0, 600);
z = z - 1;
pop();
push();
blendMode(MULTIPLY);
stroke(215, 200, 10);
translate(width / 2, height / 2);
rotate(x + 45);
line(0, -600, 0, 600);
x += 1;
pop();
push();
blendMode(LIGHTEST);
stroke(215, 200, 10);
translate(width / 2, height / 2);
rotate(z - 45);
line(0, -600, 0, 600);
z = z - 1;
pop();
push();
blendMode(MULTIPLY);
stroke(215, 200, 10);
translate(width / 2, height / 2);
rotate(x - 45);
line(0, -600, 0, 600);
x += 1;
pop();
// background circle
noStroke();
fill(0, 153, 153);
ellipse(200, 200, 370, 370);
// cab
strokeWeight(4);
strokeJoin(ROUND);
stroke(10);
fill(10);
quad(70, 140, 130, 140, 150, 230, 60, 230);
// glass
stroke(90, 255, 90);
fill(90, 255, 90);
quad(78, 146, 103, 146, 103, 186, 74, 186);
quad(114, 146, 124, 146, 132, 186, 114, 186);
// truck
stroke(255, 204, 1);
fill(255, 204, 1);
quad(142, 125, 325, 125, 325, 175, 157, 190);
noStroke();
fill(255, 204, 1);
rectMode(CORNER);
rect(50, 195, 100, 70, 4);
rect(85, 116, 250, 15, 4);
fill(60);
rect(60, 240, 30, 10);
fill(160);
rect(155, 200, 170, 60, 4);
strokeWeight(4);
strokeJoin(ROUND);
stroke(220, 160, 1);
line(156, 132.5, 311, 132.5);
strokeWeight(2.5);
beginShape(LINES);
/* for (let p = 156; p < 312; p += 10) {
vertex(p, 132.5);
}
for (let m = 171; m < 312; m += 10) {
vertex(m, 188);
}
endShape();
*/
// for (let p = 156; p < 312; p += 10) {
// for (let m = 171; m < 312; m += 10) {
// for (let n = 195; n > 175; n -= 10) {
// vertex(p, 132.5);
// vertex(m, n);
// endShape();
// }
// }
// }
line(p, o, m, n);
line(p + 155 / 4, o, m + 145 / 4, n - 17 / 4);
line(p + 155 / 2, o, m + 145 / 2, n - 17 / 2);
line(p + 155 / 4 * 3, o, m + 145 / 4 * 3, n - 17 / 4 * 3);
line(p + 155, o, m + 145, n - 17);
// line(p+q,o,m+q1,n-q2);
// wheels
noStroke();
fill(10);
rectMode(CENTER);
push();
translate(a, b);
for (let i = 0; i < 12; i += 1) {
rotate(15);
rect(0, 0, 10.5, 100, 5);
}
pop();
push();
translate(c, b);
for (let i = 0; i < 361; i += 15) {
rect(0, 0, 10.5, 100, 5);
rotate(15);
}
pop();
ellipse(a, b, r + 50);
ellipse(c, b, r + 50);
fill(255, 204, 1);
ellipse(a, b, r);
ellipse(c, b, r);
stroke(60);
strokeWeight(6);
ellipse(c, b, 14);
ellipse(a, b, 14);
}