Log inGet started
World

PYRAMID — Tower Defense

Branchmain
Branchesmain
Commit82c25f40b2

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 registerEnemy and lets it go with unregisterEnemy;
  • towers read livingEnemies() and hurt one with damageEnemy;
  • the HUD reads stone / wave / phase, sets selected, and calls requestWave();
  • 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.