Jellyfish Swarm: Flocking & Jet Propulsion (2D)
A Reynolds boids algorithm (separation, alignment, cohesion) steers each jellyfish relative to its neighbors, while a jet-propulsion pulse cycle genuinely pushes it forward during bell contraction — live readouts track the swarm's alignment order and spacing.
This 2D companion replaces the 3D version's independently-drifting jellyfish with an actual flocking algorithm: separation, alignment and cohesion forces (Reynolds boids) steer each jellyfish relative to every neighbor inside its perception radius, and a jet-propulsion pulse cycle layered on top genuinely pushes each jellyfish forward during the contraction half of its cycle — the same mechanism real jellyfish use to swim. Sliders control population, perception radius, the three flocking weights and pulse rate; live readouts report the swarm's alignment order (a Vicsek-style measure of how synchronized the swimming is) and mean neighbor distance (how tightly the swarm has clustered).
2D jellyfish swarm driven by a Reynolds boids algorithm (separation, alignment, cohesion) plus a per-agent jet-propulsion pulse cycle that adds real forward thrust during bell contraction.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install
A Reynolds boids algorithm: separation, alignment and cohesion forces computed against every neighbor inside its perception radius, the same three-rule model used to simulate bird flocks and fish schools.
Each jellyfish runs its own contraction cycle; during the contraction half of that cycle a forward thrust proportional to max(0, sin(phase)) is added along its current heading, mimicking how real jellyfish swim by expelling water from the bell.
The 3D version's jellyfish drift independently with no interaction between them. This 2D companion adds genuine flocking forces so the swarm actually reacts to itself, alongside the jet-propulsion mechanic.