Add Netwall solo client, shared simulation core and protocol spec

- public/js/sim.js: pure game rules shared by browser and server (flow-field
  pathing with no corner cutting, placement validation that can never seal the
  route, towers, enemies, waves, economy, snapshots)
- Responsive canvas client: desktop, landscape and portrait phones (board
  rotates 90 degrees in portrait), mouse + touch input, pinch zoom/pan,
  tap-to-preview placement, route preview, effects, synth sfx + music
- Local and Remote controllers behind one interface (remote: snapshot
  interpolation, auto-reconnect, seat resume)
- docs/PROTOCOL.md: co-op wire protocol and server requirements
- README, PWA manifest and icons, 20 sim unit tests

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tb8pW2KAN4oFkh1aK1BfD8
This commit is contained in:
Claude 2026-10-09 19:14:35 +00:00
commit 107ef60ec6
20 changed files with 4100 additions and 0 deletions

23
public/icons/icon.svg Normal file
View file

@ -0,0 +1,23 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<defs>
<radialGradient id="g" cx="30%" cy="20%" r="90%"><stop offset="0" stop-color="#16315c"/><stop offset="1" stop-color="#070b16"/></radialGradient>
</defs>
<rect width="512" height="512" rx="112" fill="url(#g)"/>
<rect x="20" y="20" width="472" height="472" rx="94" fill="none" stroke="#4de3ff" stroke-opacity=".4" stroke-width="6"/>
<!-- firewall bricks with a gap the route squeezes through -->
<g fill="#12305e" stroke="#5aa9ff" stroke-width="7" stroke-linejoin="round">
<rect x="96" y="112" width="96" height="58" rx="10"/><rect x="208" y="112" width="96" height="58" rx="10"/><rect x="320" y="112" width="96" height="58" rx="10"/>
<rect x="152" y="186" width="96" height="58" rx="10"/><rect x="264" y="186" width="96" height="58" rx="10"/>
<rect x="96" y="260" width="96" height="58" rx="10"/><rect x="320" y="260" width="96" height="58" rx="10"/>
</g>
<!-- the long route -->
<path d="M70 372 H256 V288 M256 288 H288 M288 288 V216 M288 216 H128 M128 216 V142 H460" fill="none" stroke="#4de3ff" stroke-width="9" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="2 22" opacity=".0"/>
<path d="M66 366 H236 V290 H292 V214 H132 V140 H236 V86" fill="none" stroke="#4de3ff" stroke-width="10" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="1 24" opacity="0"/>
<path d="M64 390 H224 V342 H296 V288 H224 V226 H128 V140" fill="none" stroke="#ffd24d" stroke-width="0" />
<path d="M60 392 C 150 392 150 340 232 340 S 300 290 300 250 S 120 250 120 214" fill="none" stroke="#4de3ff" stroke-width="11" stroke-linecap="round" stroke-dasharray="1 26" opacity=".95"/>
<circle cx="60" cy="392" r="20" fill="#ff5c7a"/><circle cx="60" cy="392" r="9" fill="#2a0c18"/>
<!-- the server -->
<rect x="396" y="334" width="76" height="96" rx="14" fill="#0d2038" stroke="#4de3ff" stroke-width="8"/>
<g stroke="#4de3ff" stroke-width="7" stroke-linecap="round"><path d="M414 358h24M414 380h24M414 402h24"/></g>
<g fill="#35e0a1"><circle cx="458" cy="358" r="5"/><circle cx="458" cy="380" r="5"/><circle cx="458" cy="402" r="5"/></g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB