← How I build
Prototype Personal project · public code · 2026

A body physics engine, checked against injury research

I wanted a toy where a body reacts to a blow through real physics, not canned animations. I had never made a game, so I directed AI coding agents to build the engine. Skin, muscle, and bone respond to each blow, and anyone can try it in a browser.

My role
I set the goals and judged the results. Coding agents wrote the code under my rules and checks, Claude Code since October 2026.
Status
A playable prototype. The browser version has been live since October 2026, and the code is public on GitHub.
Stack
One code base for Windows and the browser (WebAssembly), GitHub Pages, Claude Code
Scale
27 scripted test swings, each checked against injury research

The problem

Games usually show injuries with canned animations and painted-on wounds. I wanted every bruise, cut, and broken bone to come from the physics of the blow itself.

I started in May 2026, after I saw how much coding agents had improved.

How it grew

The first version, in June 2026, showed a simple pixel-art body. Its skin, muscle, and bone could tear and break, but the layers did not yet work well together, and bones broke along fixed patterns.

At the end of June, the agents rewrote the whole engine. In October 2026 it gained a browser version, and the body became a plain mannequin.

Then I asked for injuries that match real life. A slow push should only bruise, and a hard swing should break a bone about as often as it does in published studies.

How a change gets checked

  1. I say what looks wrong I play the game and describe the problem in plain words, such as "slow hits burst the body."
  2. Learn from others Before inventing a fix, the agent checks how open-source engines and research papers solve the problem.
  3. Change the engine It rebuilds the idea in the engine's own code and names the source in a comment.
  4. Replay the tests Every scripted swing runs 45 times, with the aim and the bone strength varied a little.
  5. Compare with research Each injury must happen about as often as the cited study says.
  6. I judge pictures The agent shows me screenshots from the real app. Then the change goes live.
  • Browser and desktopThe browser must give exactly the same results as the Windows app
  • Real sizesThe figure is a 1.75 m adult, and the hammer and bat have real weights
  • SoundEach thud and crack is made from what the physics did, with no recordings
One change, from my complaint to the live site. The agents' written rules require every check to pass.

Try it

The game runs in the browser, phones included, and nothing is installed. It shows simulated injuries, including blood.

Watch the 4-minute update on YouTube The October 2026 version: a sledgehammer bruises the arm, then breaks it.

Design decisions

  • Tests state real outcomes. I'm not a doctor or a physicist, so a number alone tells me little. Each test names what happens to a real person and the study it comes from. For example, a slow push never breaks a bone, and a knife never breaks an arm or leg bone.
  • Real blows vary. Each test swing runs 45 times, with the aim moved a little and the bones made weaker or stronger. An injury that happens "sometimes" in real life must happen in some of the runs, not in all of them.
  • Pictures, not numbers. The app can save screenshots and film strips by itself. I judge every visual change from them, and a problem that the tests miss becomes a new test.
  • The browser must match the desktop. A script plays every test in the Windows app and in a browser and compares the results. Once, they differed by a single bruise. The agents traced it to a math function that rounds differently on each platform, and replaced it.
  • Learn from others, then measure. The way knife cuts open comes from Rapier, an open-source physics engine. The way blood runs down the skin comes from the game Overgrowth. When I tried moving the whole simulation onto Rapier, it ran faster but passed fewer tests, so I kept my own engine.

Status

  • 27scripted test swings, replayed after every change
  • 45runs of each swing, with the aim and the bones varied
  • 60physics steps a second, on the visitor's own device

As of October 2026, almost every injury happens about as often as the research says. The test report lists the checks that the engine cannot meet yet. For example, a bat brought down on the shoulder never breaks the collarbone, though in real life it usually does.

The code, the tests, and the research behind them are public on GitHub.

Apart from one bruise, the pictures on this page show the body before any blow. The game itself shows simulated injuries, including blood.