feat: better walls

This commit is contained in:
Dan Finch 2026-08-04 13:09:26 +02:00
parent 81474b6bca
commit 61389f091c
3 changed files with 68 additions and 21 deletions

View file

@ -61,8 +61,9 @@ rules live in `.agents/rules/*.md`.
- `main.ts` — game loop, input, preset switching, canvas blit, FPS meter.
- `assets.ts` — load `/assets/*.png``Texture` (zero-copy; ImageData bytes
are already the `Color` layout).
- `level.ts` — builds the playground: a flat stone-floored room (three walls,
north side open) in the center of a big grassy `Terrain` world (~20x across).
- `level.ts` — builds the playground: a flat stone-floored room (three thick
walls via `slab`, north side open) in the center of a big grassy `Terrain`
world (~20x across).
Per-texture meshes incl. the outdoor grass `ground`, `Aabb` colliders, NPC
position, `Terrain` config + `GROUND_DIVISIONS`/`GROUND_UV`, sky/cloud config.
The stone floor is lifted by `FLOOR_LIFT` (a z-bias) so it stays clean over the
@ -70,8 +71,10 @@ rules live in `.agents/rules/*.md`.
quads -- no subdivision needed since texturing is perspective-correct; ground
triangle count is `GROUND_DIVISIONS` (fixed grid, so world size sets cell
chunkiness, not tri count).
- `player.ts` — feet-cylinder player: gravity/jump + circle-vs-AABB/-circle
collision; ground height comes from `Terrain.height` (plus standable AABBs).
- `player.ts` — feet-cylinder player: gravity/jump + Shift-run
(`RUN_MULTIPLIER`) + circle-vs-AABB/-circle collision, substepped so fast
running can't tunnel walls; ground height from `Terrain.height` (plus
standable AABBs).
- `index.html` — Vite entry at repo root; holds the `#screen` canvas and the
`#fps` meter div (styled inline).
- `scripts/gen-assets.ts` — procedurally draws the placeholder textures and
@ -130,9 +133,10 @@ branching in the cloud shader. Cost scales with sky resolution — fine at
## Controls
WASD move · mouse look (click canvas to pointer-lock) · **Space** jump ·
**1/2/3** switch look presets. FPS shown bottom-right. The room's north wall is
open — walk out onto the terrain and toward the peaks.
WASD move · **Shift** run (speed ×`RUN_MULTIPLIER` in `app/player.ts`) · mouse
look (click canvas to pointer-lock) · **Space** jump · **1/2/3** switch look
presets. FPS shown bottom-right. The room's north wall is open — walk out onto
the terrain and toward the peaks.
## Code style (oxlint-enforced — match it)