feat: robins

This commit is contained in:
Dan Finch 2026-08-07 13:37:30 +02:00
parent a4490f7a20
commit bd88d3cbd6
12 changed files with 159 additions and 54 deletions

View file

@ -78,12 +78,13 @@ rules live in `.agents/rules/*.md`.
`Boulder.build` appends into a shared mesh), `Bush` (cluster of small leaf
blobs, shares the oak leaf texture/mesh), `Flower` (thin stem + colored bloom;
samples a 2x2 color-atlas texture, drawn double-sided), `Mob` (a **roaming**
creature — `frog` hops the ground, `bee` hovers/darts — the engine's only
moving geometry. Unlike the baked props, a mob's low-poly mesh is built once
per kind in **local space**; `Mob.build` bakes the two canonical meshes,
`Mob.update` steps the wander AI (leashed to a home anchor, deterministic via
an evolving per-mob seed) each frame, and the live `position`/`heading`/`scale`
become a per-frame model matrix at draw time).
creature — `frog` hops the ground, `bee` hovers/darts, `robin` mostly hops but
now and then takes a short powered flight — the engine's only moving geometry.
Unlike the baked props, a mob's low-poly mesh is built once per kind in **local
space**; `Mob.build` bakes the canonical meshes, `Mob.update` steps the wander
AI (leashed to a home anchor, deterministic via an evolving per-mob seed) each
frame, and the live `position`/`heading`/`scale` become a per-frame model matrix
at draw time. New kinds extend the `MobKind` union + `MOB_KINDS` order).
- `app/` — browser glue.
- `main.ts` — game loop: input, sim, preset switching, per-frame culling, then
the non-blocking pump (`renderer.dispatch`/`done`) + `present` (GPU/CSS
@ -134,11 +135,11 @@ rules live in `.agents/rules/*.md`.
`#fps` meter div (styled inline).
- `scripts/gen-assets.ts` — procedurally draws the placeholder textures and
writes PNGs (hand-rolled encoder via `node:zlib`). Run via `bun run assets`.
- `assets/` — generated `floor/grass/bark/birch/leaf/needle/rock/flower/wall/crate/npc/frog/bee`
- `assets/` — generated `floor/grass/bark/birch/leaf/needle/rock/flower/wall/crate/npc/frog/bee/robin`
PNGs (`floor` = room stone, `grass` = outdoor ground, `bark`/`birch`/`leaf`/`needle` =
brown trunk / white birch trunk / oak leaf / spruce needle, `rock` = boulders, `flower` = 2x2 bloom-color atlas,
`frog`/`bee` = mob skin atlases: frog green + eye tone; bee stripe bands +
head-dark + wing-pale regions).
`frog`/`bee`/`robin` = mob skin atlases: frog green + eye tone; bee stripe bands +
head-dark + wing-pale; robin brown back + orange breast + dark eye/beak).
Swap for real art anytime;
filenames are the contract.
- `server/` — Bun server stub. `shared/` — isomorphic slot.