Split The code is public; the app answers only to the crew.
The body stays where it falls: a corpse until the round ends, and a camera that is not inside it #32
Check · Review · Land · Live done — Landed and live in production.
A dead player now leaves a body where they fell, and the camera no longer sits inside the mesh it is looking out of. What changed src/client/bodies.ts is the new concept.
shipped merged
Sign in to join this conversation.
new above
offline
A dead player now leaves a body where they fell, and the camera no longer sits inside the mesh it is looking out of.
What changed
src/client/bodies.tsis the new concept. ACorpseis four numbers copied out of the player at the moment of the kill — id, team, feet, yaw — plus the time;addBodydrops it to the floor under them withgroundUnder, so someone shot mid-jump lands instead of hanging. The list isworld.bodies, cleared bystartRound, capped at twenty, and deliberately notworld.effects, which is trimmed to the last two seconds.onKilladds one; so does the bomb going off, which used to erase ten people at once. Nothing is allocated inupdatefor a tick where nobody dies, andarena.resetclears the list next to the pickups so training carries no dead between episodes.fallenMatrixinmath.tstips it onto its face about the model's own Y axis so it lies along the way it was facing, flattened a little and lifted onto the floor; it topples over 0.4 s from exactly where the living mesh stood, so a kill reads as a fall rather than a pop.view), notworld.me. Spectating a teammate no longer puts the camera inside their head, and the gun in the corner is theirs while you watch them.traceBulletis untouched,movestill collides only withworld.boxes, bots never see one.Frame time. There is no GPU in this sandbox, so what I could measure is the CPU side: one frame of the scene loop against a no-op WebGL2 context costs 8–14 µs, and ten bodies add 2–6 µs of that (three runs, 4000 frames each) — under 0.04 % of a 16.7 ms budget. The GPU side is ten more draws of the 84-triangle player mesh with one matrix and one tint each;
renderer.test.tsasserts that ten bodies are exactly ten moredrawElementsand zero buffer or texture uploads. The honest 60 fps check is the preview's own counter in the corner of the view, with a round played out to ten corpses.Tests.
bun testis green, 202 passing.bodies.test.tscovers a kill adding one,startRoundclearing them, the bound holding over 400 kills, the drop to the floor, and that nothing collides with a body or shoots it;renderer.test.tsruns a frame against a recording context (the same trickhud.test.tsalready uses) and fails if the skip goes back toworld.me;math.test.tspins the fallen transform. No dependencies added.What I left out. Bodies are not on the radar and not in the kill feed's geometry, a body is not searchable or lootable, and it does not sink through a floor that moves — the map has none. The pose is one topple, not a ragdoll: the mesh is seven boxes and per-limb physics would be a second simulation for a decoration.
🤖 Generated with Claude Code
Closes #28