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.
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.
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.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install