Home▸Animals & Their World▸Kick Shark Physics Simulator (2D)

Kick Shark Physics Simulator (2D)

A 2D side-view companion to the 3D tank scene: kick the shark and watch the same impulse-and-drag physics play out on a flat cross-section — a click-triggered impulse sets its velocity, linear and quadratic water drag bleed off speed, and a damped buoyancy spring pulls its depth back toward mid-tank.

Animals & Their World2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-kick-shark-physics-simulator ↗ Open standalone

This 2D companion strips the 3D tank scene down to a side-view cross-section driven by the same physics: a kick applies an impulse — a velocity change equal to the impulse divided by the shark's mass — in the direction away from where you click, or in a randomized upward arc from the Kick button. From there, motion is opposed by a linear drag term and a quadratic drag term that scales with speed squared, both standing in for water resistance, while a damped spring continuously pulls the shark's depth back toward the tank's mid-height equilibrium the way neutral buoyancy would. Push the resistance slider up and the same kick produces a shorter glide; push buoyancy up and depth overshoot snaps back faster; raise wall bounce and hits against the tank glass return more of the shark's speed.

⚙ Under the hood

Impulse-driven kick (velocity += impulse / mass), linear plus speed-squared quadratic water drag, a damped buoyancy spring toward mid-tank equilibrium depth, and restitution-based wall bounces, all exposed as live sliders with a speed / impulse / depth-error readout panel.

momentum transferwater dragbuoyancyimpulseshark

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

Is the water physics here real or just decoration?

It is formula-driven: a kick applies an impulse (velocity change equal to impulse divided by mass), motion is opposed by both a linear and a speed-squared quadratic drag term, and depth is pulled back toward mid-tank by a damped spring standing in for buoyancy.

Why does the shark always drift back to the same depth?

The buoyancy control is a damped spring force proportional to how far the shark is from the tank's equilibrium depth, the same restoring behavior a neutrally buoyant body shows in water.

What changes if I raise water resistance?

Both drag terms scale up together, so the same kick impulse produces a shorter, faster-decaying glide — modeling denser or more viscous water.

What did you find?

Add reproduction steps (optional)