jungleKit.package
This package holds more than this page lists. See all of its files in its world.
README.md
JungleGoal
A goal at any stop of the jungle's walk, the temple summit by default, in one line. Put it on any
entity of a scene with a jungleKit.Jungle:
entity.spawn("Goal").component.add("jungleKit.JungleGoal", {})
In play each player sees their own "Climb to the Temple Summit: 84 m" at the bottom centre (a
JungleHud.SAFE spot, clear of the route guide's compass and tracker, its toasts and the
time-and-weather button), and "You reached the Temple Summit in 74 s!" once they stand there. The
player is this machine's own (JungleBuilder.localBody()), so every player in a multiplayer game
has their own distance, time and goal.
Fields: target (a poi id: templeTop by default, or templeStairs, temple, clearing, bridge,
riverbank, waterfall, plungePool, spawn), radius (5 m across the ground), below (1.5 m:
how far under the stop's floor still counts), message and doneMessage (templates with {target},
{distance}, {time}; an empty doneMessage removes the message), corner (bottom, topLeft,
topRight), showInEditor.
Methods: reached(), seconds(), reset(), targetPoi(). Event: onReached { seconds, target }
(local, fired once), plus the log line JungleGoal: reached <target> in <n> s.
local goal = entity.find("Goal").component.get("jungleKit.JungleGoal")
goal.events.onReached:connect(function(e) print("made it in", math.floor(e.seconds), "s") end)