Shadow Run.
Five shadows. One tiny reflex. Let the brain take a run.
A scent starts the run. Each obstacle sends a shadow signal; the response becomes jump height.
The reflex, in code.
A scent starts the run. Each obstacle sends a shadow signal; the response becomes jump height.
The fly’s side of the conversation
REQUEST EXAMPLE / NOT SENT YETconst response = await fetch("/api/v1/run?view=drive", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ "stimulus": "loom", "intensity": 1, "duration_ms": 100, "seed": 42 })});const brain = await response.json();// Play the project above.// Its actual response appears here.brain.channels // neural activity, Hzbrain.drive // movement controls, 0–1A neural signal becomes a move.
The brain supplies the jump multiplier. The game supplies the trajectory and checks whether the fly clears the obstacle.
const reflex = clamp(brain.drive.escape, 0, 1);const jump = clamp((phase - 0.39) / 0.50, 0, 1);const height = Math.sin(Math.PI * jump) * 115 * reflex;Set Reflex signal to 0 before the next shadow. Zero escape drive produces zero jump height, and the runner hits the obstacle.
Run this example in your own project
Download the single HTML file and open it in a browser, or serve it on your own website. It calls the public API directly; there is no local brain model, package install or API key. The “API connection” panel lets you change the server address.
A complete run uses six requests. The free alpha allows 30 requests per minute per IP address. The current free server address may change; use the address shown on the Neuro API page. Network errors pause the example and show a message.