Log inGet started
World

PYRAMID — Tower Defense

Branchmain
Branchesmain
Commit82c25f40b2

README.md

Enemy

One of the dead. The EnemyDirector spawns an entity per body and attaches this component to it; from there the body carries its own life.

  • Walks the causeway on the exact curve pyramid.rules.pointAt draws the road with, offset sideways by lane, and turns to face that curve's heading.
  • Publishes an EnemyRecord into pyramid.state (progress kept live in metres along the path) and fills the record's hit and takeLeak, so a tower hurts it through State.damageEnemy without knowing what an enemy is.
  • Dies into dust, pays rules.ENEMIES[kind].bounty stone through State.gain and emits a kill event with its position.
  • On reaching the seal, emits leak, then State.shatter(leak), which is what takes courses off the pyramid.

kind picks the body's size, speed, health and tone out of rules.ENEMIES: husk, scarab, guard, colossus.

The body is chiselled from primitives in one unit (feet at y = 0, facing +Z, 2.6 m to the ear tips), scaled by the kind's scale: a black jackal-headed bandage-wrapped raider with a tarnished gold collar, a turquoise scarab amulet and a bronze khopesh. That build is the slot a generated wraith mesh replaces; nothing else about the body depends on it.

Attaches to a bare entity the director creates at runtime. Needs pyramid.rules and pyramid.state, and the standard lit material for its blocks.