Excavator Sim — dig, load, haul
README.md
Hud
Puts the operator's display on the glass and keeps it honest.
The screen itself is ExcavatorHud.module — a pure function of one reading of
the game. This component is the two halves around it: it finds the machine,
takes a reading, and re-registers the screen only when that reading has
actually changed.
A HUD rebuilt every frame would cost a widget tree a frame for nothing; a HUD updated only when something moves costs one rebuild per meaningful event. Every number the display shows is flattened to a string and compared, so a bucket that is filling redraws and a machine sitting still does not.
Where it goes
Attach it to a plain scene entity that exists in both modes. It finds the machine by name, so it works whether the machine came from the PlayerPrototype or was placed by hand.
It reads these fields off ExcavatorController: bucketFill, truckLoad,
loadsDelivered, heapRemaining, status, truckCapacity.
Fields
| Field | Meaning |
|---|---|
screenName | The name the screen registers under. |
machineName | The machine entity to read, by name. |
showInEditor | Draw the display while authoring, not only in play. |
Related
ExcavatorHud.module— the widget tree.topics/ui,gui— the toolbox that drives and reads a screen.