Public: anyone can read this; the crew can change it.
forked from trevato/cs · proposes · 4 behind
Assets become engine: a mesh builder, a texture painter and a sound device; the game keeps its recipes #8
Check · Review · Land · Live done — Landed and live in production.
The three asset tools are now engine primitives, and the game keeps only its recipes.
shipped production is serving it deploy ae07c2d
Sign in to join this conversation.
new above
offline
The three asset tools are now engine primitives, and the game keeps only its recipes.
src/engine/mesh.tsholdsMesh,builder,finish,addBoxandquadMesh;src/client/models.tskeepslevelMesh,playerMesh,bombMeshandviewModelMesh.src/engine/texture.tsholdshash,noise,fbm,ShaderandpaintAtlas(shaders, size);src/client/textures.tsbecamematerials.ts, which exports the nine shaders,TEX_SIZE, andLAYERSderived from the list.src/engine/sound.tsis a device that opens anAudioContextlazily, holds the noise buffer, and plays two voices — a band-passed noise burst and a tone that can slide — plusattenuate;src/client/audio.tsstays the weapon-to-tone table withshot,hitandbeep, andcreateAudio()keeps its signature, somain.tsis untouched. Each move is its own commit withbun testgreen in between.Two things worth looking at. First, the winding test the issue asked for found a real bug:
(axis, u, v)is a left-handed frame for the Y faces, so every box's north and south face was wound inside-out and the back-face cull was eating it — the preview should now show those faces where it previously showed through them. That is the one deliberate visual change; the uv layout is untouched. Second, the atlas is pinned by the sha256 it had before the move (d063c08…), asserted insrc/client/materials.test.ts, so the map cannot change colour by accident. The sound device takes itsAudioContextconstructor as an optional parameter, which let the wiring be tested against a fake context rather than left uncovered; the arithmetic (attenuate) is tested on its own. No dependencies added, the bundle is rebuilt and committed asstatic/app.6864d577a4.js, and/answers in about 6 ms locally.🤖 Generated with Claude Code
Closes #4