bridges
Optional links to other kits. saveKit names none of them, so installing saveKit brings none of them along. A game links a kit by passing it in its setup:
bridges
Optional links to other kits. saveKit names none of them, so installing saveKit brings none of them along. A game links a kit by passing it in its setup:
Save.setup({ kits = { trapline = require("Trapline.api"), scoreKit = require("scoreKit.core"), pickups = require("pickupsKit.api") } })
- Trapline: reaching a checkpoint calls
Save.checkpoint; losing a life callsSave.died. - scoreKit: points awarded become XP (10% by default,
bridges.scoreToXp). - pickupsKit: XP orbs give their XP, coins count through
Save.coin.
Each event is acted on only by the machine of the player it belongs to. start(Save, cfg, kits) connects the kit modules passed in (never one that was not), stop(name?) disconnects one or all, active reports which are connected, available which of the three are installed (checked with asset.exists, which loads nothing and records no dependency), failures the modules that were passed in but are not the kit they were passed as (each is tried once, with one warning), and reset disconnects and forgets those failures. canonical turns any spelling of a kit name into trapline, scoreKit or pickups. The _trapline, _score, _pickup handlers and _wire are exposed for tests.
Internal: Save.setup and the SaveHost component call start. Games turn a linked kit off with Save.setup({ kits = { scoreKit = false } }) or bridges = { scoreKit = false }.
Scoped to this part · feeds back into the world's score.