← Monsters and enemies3D assetfogon/kraken
Kraken
Drag to turn it// «Kraken» · gpt-6-sol (medium)
// A cartoon kraken rising from a disk of dark blue water on the floor: a huge red-purple octopus head with big glowing yellow eyes facing -y and a frowning brow, and six thick suckered tentacles curling up out of the water around it.
// Dark-blue water disk
cylinder(24, 24, 0, 21, 2, "#102746");
cylinder(24, 24, 2, 20, 1, "#19476a");
for (let i = 0; i < 110; i++) {
const a = rand() * Math.PI * 2;
const r = 8 + rand() * 12;
const x = Math.round(24 + Math.cos(a) * r);
const y = Math.round(24 + Math.sin(a) * r);
set(x, y, 3, rand() < 0.35 ? "#4191a2" : "#286d89");
}
// Broken, bright ripple arcs around the creature
for (let r of [9, 15, 19]) {
for (let a = 0; a < Math.PI * 2; a += 0.09) {
if (Math.sin(a * 7 + r) > 0.15) {
set(24 + Math.cos(a) * r, 24 + Math.sin(a) * r, 3,
r === 19 ? "#286d89" : "#34869a");
}
}
}
// Thick neck and oversized, bulbous head
ellipsoid(24, 24, 13, 7, 7, 10, "#63204e");
ellipsoid(24, 23, 26, 11, 9, 12, "#9d3269");
forEach((x, y, z, color) => {
if (color !== "#63204e" && color !== "#9d3269") return;
let shade = z < 17 ? "#612049" :
z < 23 ? "#822759" :
z > 32 ? "#bb477c" : "#a3316a";
if (rand() < 0.09) shade = z > 27 ? "#c55386" : "#ad3c72";
set(x, y, z, shade);
});
// A softly raised face and rounded cheeks
ellipsoid(24, 14.5, 20, 6, 2.5, 4, "#aa3971");
ellipsoid(17, 16, 23, 2, 1.5, 2, "#b84779");
ellipsoid(31, 16, 23, 2, 1.5, 2, "#b84779");
// Large luminous eyes, with heavy dark sockets
for (const ex of [19, 29]) {
ellipsoid(ex, 13.8, 29, 3.5, 2, 4, "#4e1949");
ellipsoid(ex, 12.3, 29, 2.45, 1.25, 3, "#ffcc35");
ellipsoid(ex, 11.45, 29.4, 1.65, 0.55, 2.2, "#ffec78");
ellipsoid(ex, 10.9, 28.4, 0.65, 0.35, 1.3, "#573046");
set(ex - 1, 10, 30, "#fff6bd");
}
// Inward-sloping, frowning brows
line(16, 13, 34, 22, 12, 31, 1.35, "#571a48");
line(26, 12, 31, 32, 13, 34, 1.35, "#571a48");
line(16, 12.8, 35, 21, 11.8, 32, 0.55, "#d4588d");
line(27, 11.8, 32, 32, 12.8, 35, 0.55, "#d4588d");
// A little downturned, cartoon mouth
line(20, 12, 21, 22, 11.8, 19, 0.75, "#49183f");
line(22, 11.8, 19, 24, 11.7, 18, 0.75, "#49183f");
line(24, 11.7, 18, 26, 11.8, 19, 0.75, "#49183f");
line(26, 11.8, 19, 28, 12, 21, 0.75, "#49183f");
set(21, 11, 22, "#d86596");
set(27, 11, 22, "#d86596");
// Smooth paths let the six arms curl upward and inward.
function pointOnPath(p, t) {
const n = p.length - 1;
const v = Math.min(t * n, n - 0.0001);
const i = Math.floor(v), f = v - i;
const a = p[Math.max(0, i - 1)], b = p[i];
const c = p[i + 1], d = p[Math.min(n, i + 2)];
return [0, 1, 2].map(k => 0.5 * (
2 * b[k] + (-a[k] + c[k]) * f +
(2*a[k] - 5*b[k] + 4*c[k] - d[k]) * f*f +
(-a[k] + 3*b[k] - 3*c[k] + d[k]) * f*f*f
));
}
function tentacle(name, path, axis, speed) {
part(name, path[0]);
for (let i = 0; i <= 48; i++) {
const t = i / 48;
const [x, y, z] = pointOnPath(path, t);
const r = 3.15 - 1.25 * t;
const shade = t < 0.24 ? "#692251" :
t < 0.7 ? "#983166" : "#bd4980";
sphere(x, y, z, r, shade);
// A narrow lighter ridge makes each curl readable.
if (i % 3 === 0 && t > 0.15)
sphere(x, y, z + r * 0.63, 0.85, "#d36091");
}
// Pale, indented suckers along the forward-facing side.
for (let t = 0.14; t < 0.96; t += 0.075) {
const [x, y, z] = pointOnPath(path, t);
const r = 3.15 - 1.25 * t;
ellipsoid(x, y - r + 0.12, z - 0.25, 0.95, 0.5, 0.95, "#e79ab4");
ellipsoid(x, y - r - 0.32, z - 0.25, 0.43, 0.24, 0.43, "#913a6a");
}
animate(name, { type: "swing", axis, speed, amplitude: 0.3 });
}
tentacle("frontLeft",
[[18,17,3],[12,13,6],[6,12,12],[5,12,21],[8,12,28],[11,12,26]],
"y", 2);
tentacle("frontRight",
[[30,17,3],[36,13,6],[42,12,12],[43,12,21],[40,12,28],[37,12,26]],
"y", -2);
tentacle("sideLeft",
[[17,25,3],[11,26,7],[5,26,13],[5,26,22],[8,25,29],[11,24,27]],
"x", -2);
tentacle("sideRight",
[[31,25,3],[37,26,7],[43,26,13],[43,26,22],[40,25,29],[37,24,27]],
"x", 2);
tentacle("backLeft",
[[19,30,3],[15,35,7],[12,39,14],[14,40,22],[18,38,28],[20,35,25]],
"y", 2);
tentacle("backRight",
[[29,30,3],[33,35,7],[36,39,14],[34,40,22],[30,38,28],[28,35,25]],
"y", -2);
part("body");import { draw } from "./assets/voxel";
import { kraken } from "./assets/kraken";
// Every frame: standing on (x, y), the centre of its base.
draw(ctx, kraken, x, y, { size: 64, angle: 0, t: performance.now() / 1000 });
// size: its longest side, in px
// angle: turn on the floor, in radians
// t: seconds; if it moves, that animates it# In a terminal, in the game's folder
fogon assets add kraken
# With Fogón's tools (connector)
add_assets({ slug: "<your-game>", ids: ["kraken"] })
# It lands in client/assets/kraken.ts
# https://fogon.page/object/kraken