Home▸Animals & Their World▸Pistol Shrimp Snap Lab (2D)

Pistol Shrimp Snap Lab (2D)

A 2D top-down cavitation-shockwave simulation: the shrimp cocks its oversized claw when prey drift into range, then fires an instantaneous snap whose sound-pressure level falls off with distance until it drops below the stun threshold.

Animals & Their World2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-pistol-shrimp-burrow ↗ Open standalone

This 2D companion turns the pistol shrimp's famous claw-snap into a distance-based physics readout rather than a 3D scene to admire. Each snap is modelled as a near-instant cavitation event: a sound-pressure level that starts around 195-215 dB at the claw tip and falls off at -20 dB per tenfold increase in distance, so the stun radius shown live is a direct consequence of the shockwave-power slider rather than a fixed animation. A goby sentinel watches for the predator button and, depending on alert sensitivity, warns the shrimp to retreat before its next snap.

⚙ Under the hood

2D canvas simulation of a pistol shrimp's cavitation snap: sound-pressure level decays with distance via spherical spreading (-20·log10(r/r0)), giving a stun radius that scales with the shockwave-power control; prey drift into a configurable detection range and get stunned once inside that radius, while a goby sentinel's alert sensitivity gates how fast a predator event triggers a retreat.

pistol shrimpcavitationshockwavesound pressure levelpredator-prey2D

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)