Log inGet started
World

Harbor Lanterns

Branchmain
Branchesmain
Commit71d689c1f5

README.md

CrabScuttle

Makes a small crab wander sideways around its home stone in a tidepool. When a player comes close it runs back and hides under the stone, then peeks out and resumes wandering once things are quiet. Attach it to an entity with a Transform.

Public fields

  • homeRadius: number — how far from its home stone the crab wanders, in metres.
  • fleeDistance: number — how close a player gets before the crab hides, in metres.
  • hideSeconds: number — how long it stays hidden after the player leaves.

Lifecycle

  • update(dt) — wanders sideways, or runs home and hides when a player is near.