fogón

← Level pieces 23D assetfogon/nivel-hongo

Hongo de poder

by fogonCC013265 blocks
Hongo de poderDrag to turn it
// «Hongo de poder» · gpt-6-sol (medium)
// A power-up mushroom: a big round red cap (a half sphere radius 16) with large white round spots, on a chunky cream stem (radius 9, 12 tall) with two big black oval eyes on the front (-y); a lighter red highlight on the top left of the cap.

part("hongo", [24, 24, 0]);

const cx = 24, cy = 24;
const cream = "#f6e5ba";
const creamLight = "#fff0d0";
const creamShade = "#dec99e";

// Chunky, solid stem.
for (let z = 0; z <= 13; z++) {
  for (let x = 15; x <= 33; x++) {
    for (let y = 15; y <= 33; y++) {
      if ((x - cx) ** 2 + (y - cy) ** 2 > 81) continue;
      let color = x < 22 && z > 2 ? creamLight : cream;
      if (z < 2 || x > 30) color = creamShade;
      set(x, y, z, color);
    }
  }
}

// Dark red underside and crisp, broad rim.
for (let z = 11; z <= 13; z++) {
  const radius = z === 11 ? 15 : 16;
  for (let x = 8; x <= 40; x++) {
    for (let y = 8; y <= 40; y++) {
      if ((x - cx) ** 2 + (y - cy) ** 2 <= radius ** 2)
        set(x, y, z, z === 11 ? "#a91e2b" : "#c92530");
    }
  }
}

// Solid hemispherical cap.
for (let z = 14; z <= 29; z++) {
  for (let x = 8; x <= 40; x++) {
    for (let y = 8; y <= 40; y++) {
      if ((x - cx) ** 2 + (y - cy) ** 2 + (z - 13) ** 2 > 256) continue;
      let color = z < 17 ? "#dd2932" : z > 23 ? "#f33a3c" : "#eb3035";
      if (x < 22 && z > 20) color = "#fa4845";
      set(x, y, z, color);
    }
  }
}

// Large white spots follow the curved cap surface.
const spots = [
  [24, 9, 17, 4.0],
  [14, 16, 21, 3.8],
  [34, 16, 21, 3.8],
  [23, 22, 28, 3.6],
  [32, 27, 25, 3.2]
];
for (let z = 14; z <= 29; z++) {
  for (let x = 8; x <= 40; x++) {
    for (let y = 8; y <= 40; y++) {
      if (!get(x, y, z)) continue;
      const radial = Math.sqrt((x - cx) ** 2 + (y - cy) ** 2 + (z - 13) ** 2);
      if (radial < 13.2) continue;
      for (const [sx, sy, sz, r] of spots) {
        if ((x - sx) ** 2 + (y - sy) ** 2 + (z - sz) ** 2 <= r * r) {
          set(x, y, z, z > sz ? "#ffffff" : "#f5f3e9");
          break;
        }
      }
    }
  }
}

// Soft, lighter-red shine on the upper-left of the cap.
for (let z = 23; z <= 28; z++) {
  for (let x = 14; x <= 22; x++) {
    for (let y = 17; y <= 25; y++) {
      const d = ((x - 18) / 5) ** 2 + ((y - 20) / 5) ** 2 + ((z - 26) / 3) ** 2;
      if (d > 1 || !get(x, y, z)) continue;
      const radial = Math.sqrt((x - cx) ** 2 + (y - cy) ** 2 + (z - 13) ** 2);
      if (radial > 13.5 && radial <= 16)
        set(x, y, z, "#ff7770");
    }
  }
}

// Two tall oval eyes on the front of the stem.
for (const ex of [20, 28]) {
  for (let x = ex - 2; x <= ex + 2; x++) {
    for (let z = 4; z <= 10; z++) {
      if (((x - ex) / 2.05) ** 2 + ((z - 7) / 3.4) ** 2 > 1) continue;
      const front = Math.round(cy - Math.sqrt(Math.max(0, 81 - (x - cx) ** 2)));
      set(x, front - 1, z, "#171923");
    }
  }
  set(ex - 1, 15, 9, "#ffffff");
}

animate("hongo", { type: "bob", axis: "z", speed: 2, amplitude: 1.5 });