PYRAMID — Tower Defense
README.md
pyramid.state
The live game state: the phase (title → build → wave → won / lost),
the pyramid's stone, the wave number, the dead currently walking, and the
towers standing on the plinths.
It is the one surface the slices share, so no two of them need to know about each other:
- the enemy director registers each wraith with
registerEnemyand lets it go withunregisterEnemy; - towers read
livingEnemies()and hurt one withdamageEnemy; - the HUD reads
stone/wave/phase, setsselected, and callsrequestWave(); - the pyramid visual subscribes with
on("stone", fn)and shows as many courses as there are stone.
Spending stone is spending the pyramid: spend refuses when the courses are not
there, and shatter is what an enemy reaching the seal does.