Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit9cba27a611

README.md

launcher.rounds

The picture rounds a first game is chosen in on the create screen and in the editor's Ideas dock: Hero, World, Play and Look. Each round offers six pictures and a die. A picture shows a thing a first game is built from: a published kit part, environment or look, by its own preview or by a crop of its world's cover that holds no letters. An option with no picture is never offered.

Each round is told apart by its frame shape (circle, rounded square, hexagon, drop) as well as by its hue from the Okabe-Ito colour-blind safe set, so a greyscale screen still shows which round is on. The caption under a picture is read from the catalog (zeromind_tab.idea.option.<round>.<name>) and its pool words are its tags.

A tap chooses a picture, and Keep (or a second tap) keeps it and moves on to the next round nobody has kept. The progress row shows each round's kept picture in its frame; pressing one goes back to that round. Undo drops the chosen picture, else takes back the last kept one. The idea names each kept picture by its round and caption, and DotBot is handed it with the published parts they stand for (rounds.partsLine).

Everything here is pure: the screen hands it the state, a random source and the catalog lookup.

Example

local Rounds = require("@builtin::modules.api.engine.launcher.rounds")
local state = Rounds.start(function(n) return math.random() * n end)
Rounds.choose(state, 1)   -- the first hero, chosen
Rounds.keep(state)        -- kept; the World round is on show
print(Rounds.current(state).key, Rounds.compose(state, i18n.t))