fogón

← ArmasObjeto 3Dfogon/arma-lanzacohetes

Lanzacohetes

de fogonCC03415 bloques
LanzacohetesArrastrá para girarlo
// «Lanzacohetes» · propio
// A green military rocket launcher tube (bazooka) with a red rocket warhead sticking out the front.

const colors = () => {};
part("body");

// ===== rear exhaust flare =====
cylinder(2, 24, 5, 5, 4, "#3d5a30", "x");
cylinder(2, 24, 5, 3, 2, "#16200f", "x");

// ===== main tube =====
cylinder(5, 24, 5, 5, 32, "#4a6b3a", "x");

// ===== muzzle ring =====
cylinder(34, 24, 5, 5, 3, "#2c4222", "x");

// ===== color bands =====
cylinder(16, 24, 5, 5, 2, "#3d5a30", "x");
cylinder(22, 24, 5, 5, 2, "#c9a227", "x");

// ===== red rocket warhead sticking out the front =====
cylinder(37, 24, 5, 4, 4, "#c0392b", "x");
cylinder(39, 24, 5, 4, 1, "#e8dcc0", "x");
const noseR = [3.4, 2.9, 2.3, 1.7, 1.1, 0.5];
for (let i = 0; i < noseR.length; i++) {
  cylinder(41 + i, 24, 5, noseR[i], 1, "#c0392b", "x");
}
set(46, 24, 5, "#f2ead8");

// ===== shade pass: top light, belly dark =====
forEach((x, y, z, c) => {
  if (c === "#4a6b3a") {
    const dz = z - 5;
    if (dz >= 3) set(x, y, z, "#628c4a");
    else if (dz <= -3) set(x, y, z, "#35502a");
  } else if (c === "#c0392b") {
    const dz = z - 5;
    if (dz >= 2) set(x, y, z, "#d9523f");
    else if (dz <= -2) set(x, y, z, "#8e2b20");
  }
});

// ===== scope on top =====
cylinder(8, 24, 12, 2, 7, "#3a3a3a", "x");
box(9, 23, 10, 13, 25, 10, "#2a2a2a");

part("lens", [14, 24, 12]);
for (let y = 23; y <= 25; y++) {
  for (let z = 11; z <= 13; z++) {
    if (get(14, y, z)) set(14, y, z, "#4fe0ff");
  }
}

part("body");

// ===== pistol grip (sticks out the side, weapon lies flat) =====
box(26, 15, 2, 30, 21, 8, "#3a3a3a");
box(26, 15, 7, 30, 21, 8, "#4c4c4c");

// ===== rivets / bolts =====
for (const x of [9, 12, 15, 24, 27, 30, 33]) {
  set(x, 29, 5, "#2c4222");
  set(x, 19, 5, "#2c4222");
}

// ===== status LEDs =====
part("led", [19, 19, 5]);
set(18, 19, 5, "#5aff7a");
set(19, 19, 5, "#ffe45a");
set(20, 19, 5, "#ff5a3a");

// ===== flip-up front sight =====
part("sight", [31, 24, 10]);
box(31, 23, 10, 32, 25, 13, "#2c4222");
box(31, 23, 13, 32, 25, 13, "#3d5a30");
set(31, 24, 13, "#16200f");
set(32, 24, 13, "#16200f");

// ===== animation =====
animate("sight", { type: "swing", axis: "y", speed: 0.8, amplitude: 0.13 });
colors("lens", { palette: ["#4fe0ff", "#b8f4ff", "#2aa8d8"], pattern: "pulse", speed: 1.1, glow: 1 });
colors("led", { palette: ["#5aff7a", "#ffe45a", "#ff5a3a"], pattern: "flicker", speed: 2.2, glow: 1 });