feat: bees and frogs

This commit is contained in:
Dan Finch 2026-08-07 12:49:13 +02:00
parent 46e7070b6b
commit 16f205babe
13 changed files with 540 additions and 31 deletions

View file

@ -194,6 +194,31 @@ const crate: Shade = (x, y) => {
return [140 + n, 96 + n, 46 + n, 255]
}
// Frog skin atlas: green mottled skin with a lighter belly on the left (u<0.71),
// a dark eye tone on the right (mapped by the eye/haunch bumps' UVs).
const frog: Shade = (x, y) => {
const n = noise(x, y) * 10
if (x < 34) {
const belly = (y / 48) * 28
return [66 + n, 120 + belly + n, 60 + n, 255]
}
return [26 + n, 42 + n, 30 + n, 255]
}
// Bee atlas: yellow/black stripe bands down the left (u<0.54, banded by y so the
// body stripes across its length), a dark head tone in the middle, pale wings on
// the right.
const bee: Shade = (x, y) => {
const n = noise(x, y) * 8
if (x < 26) {
return Math.floor(y / 6) % 2 === 0 ? [250 + n, 206 + n, 42 + n, 255] : [30 + n, 26 + n, 14 + n, 255]
}
if (x < 38) {
return [36 + n, 30 + n, 18 + n, 255]
}
return [228 + n, 238 + n, 248 + n, 255]
}
// 48x64, transparent background, a simple round-topped figure with eyes.
const npc: Shade = (x, y) => {
const dx = (x - 24) / 17
@ -231,6 +256,8 @@ const assets: Array<[string, number, number, Shade]> = [
["wall", 64, 64, wall],
["crate", 64, 64, crate],
["npc", 48, 64, npc],
["frog", 48, 48, frog],
["bee", 48, 48, bee],
]
for (const [name, w, h, shade] of assets) {