Home▸Earth▸Sandcastle & Wave Erosion (2D)

Sandcastle & Wave Erosion (2D)

A 2D cross-section of a beach: ocean waves sweep in on a state-machine cycle and erode the nearest castle segments first, until the whole structure collapses and rebuilds.

Earth2DEasy60 FPS📱 Mobile-adapted⇄ 3D version
2d-n84-sandcastle-wave-erosion ↗ Open standalone

This 2D companion drives the same erosion cycle as the 3D original through a plain cross-section view: waves sweep in with a strength set by the wave-energy slider, the segments nearest the shoreline lose height first, and how fast the whole castle collapses depends on sand cohesion and how high the tide slider pushes the water line — once fully eroded, the structure rebuilds and the cycle starts again.

⚙ Under the hood

A state-machine erosion cycle (stable → eroding → rebuilding) ports the 3D original's per-segment erosion ranking to a 2D beach cross-section, with wave energy, sand cohesion and tide level as live parameters.

coastal erosionwave actionsand cohesiontidesbeach profile

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

What did you find?

Add reproduction steps (optional)