fogón

← Level pieces 23D assetfogon/nivel-barril-explosivo

Barril explosivo

by fogonCC013708 blocks
Barril explosivoDrag to turn it
// «Barril explosivo» · gpt-6-sol (medium)
// A red explosive barrel: a cylinder radius 12, 30 tall, centered, bright red painted metal in 3 shades with two dark grey metal hoops at z 6 and z 24, a big yellow-black hazard band with a black flame symbol on the front (-y), a darker rim and a small cap on top, a few scratches showing grey metal.

const cx = 24, cy = 24, radius = 12;

const redLight = "#f44336";
const redMid = "#df282b";
const redDark = "#b91e29";
const hoopLight = "#626b73";
const hoopDark = "#39424a";
const yellow = "#ffd637";
const yellowShade = "#e9b923";
const black = "#292b31";

// Solid painted-metal barrel, 30 blocks tall.
for (let x = 12; x <= 36; x++) {
  for (let y = 12; y <= 36; y++) {
    const d2 = (x - cx) ** 2 + (y - cy) ** 2;
    if (d2 > radius ** 2) continue;

    const outer = d2 >= 10.3 ** 2;
    for (let z = 0; z < 30; z++) {
      let color = y < 20 ? redLight : y < 29 ? redMid : redDark;
      if (z < 2 || z > 27) color = redDark;

      // Continuous yellow hazard band.
      if (outer && z >= 10 && z <= 20) {
        color = y < 24 ? yellow : yellowShade;
      }

      // Raised dark metal hoops, centered at heights 6 and 24.
      if (outer && ((z >= 5 && z <= 7) || (z >= 23 && z <= 25))) {
        color = z === 7 || z === 25 ? hoopLight : hoopDark;
      }
      if (outer && z === 29) color = hoopDark;

      set(x, y, z, color);
    }

    // Flat inset top inside its dark rim.
    if (d2 < 10.3 ** 2) set(x, y, 29, "#bb2930");
  }
}

// Black diagonal hazard stripes wrap around the sides of the yellow band.
for (let x = 12; x <= 36; x++) {
  for (let y = 12; y <= 36; y++) {
    const d2 = (x - cx) ** 2 + (y - cy) ** 2;
    if (d2 < 10.3 ** 2 || d2 > radius ** 2) continue;
    if (y < 24 && x >= 16 && x <= 32) continue;

    const angle = Math.atan2(y - cy, x - cx);
    for (let z = 10; z <= 20; z++) {
      const stripe = Math.floor((angle + Math.PI) * 6 + (z - 10) * 0.7);
      if (((stripe % 7) + 7) % 7 < 2) set(x, y, z, black);
    }
  }
}

// Find the visible front surface at each x position.
function frontY(x) {
  return Math.round(cy - Math.sqrt(radius ** 2 - (x - cx) ** 2));
}

// Crisp black border around the central yellow warning panel.
for (let x = 16; x <= 32; x++) {
  const y = frontY(x);
  set(x, y, 10, black);
  set(x, y, 20, black);
}
for (let z = 10; z <= 20; z++) {
  set(16, frontY(16), z, black);
  set(32, frontY(32), z, black);
}

// Chunky black flame silhouette, pointed at the top.
const flame = [
  ".....#.....",
  "....##.....",
  "...###..#..",
  "...####.##.",
  "..########.",
  "..########.",
  "...######..",
  "...######..",
  "....####..."
];
for (let row = 0; row < flame.length; row++) {
  for (let col = 0; col < flame[row].length; col++) {
    if (flame[row][col] === "#") {
      const x = 19 + col;
      set(x, frontY(x), 19 - row, black);
    }
  }
}

// Narrow metallic scratches in the exposed red paint.
for (const [x, z, length] of [
  [18, 3, 3], [19, 4, 2], [31, 3, 2],
  [17, 26, 2], [29, 27, 2], [32, 26, 2]
]) {
  for (let i = 0; i < length; i++) {
    set(x + i, frontY(x + i), z, i === 0 ? "#727b80" : "#a4adb0");
  }
}

// Rolled upper lip and a small raised filler cap.
cylinder(cx, cy, 30, 10, 1, "#414950");
cylinder(cx, cy, 30, 8, 1, "#b92a30");
cylinder(cx, cy, 31, 4, 1, "#424b53");
cylinder(cx, cy, 32, 3, 1, "#879198");
box(23, 22, 32, 25, 22, 32, "#b7c0c3");