Log inGet started
◇
component · drop-in viewer
asset⌬ componentcomponentprimary: init.luau·originates fromworld 850de0df-a…

ScreenHost

Blockhaven's screens in play: the title screen until the player presses PLAY, then the in-play HUD.

by◐zain10_gaming·posted 25d ago
What it does

game.ScreenHost

Blockhaven's screens in play: the title screen until the player presses PLAY, then the in-play HUD.

Attach it to one entity (the scene's ScreenHost) with no settings:

host.component.add("game.ScreenHost", {})

It registers the two screens game/screen.module authors, on layers 600 (the title) and 40 (the HUD), and swaps between them on the PLAY callback. The screens belong to this component's instance, so they go when the entity does.

The HUD shows the coins the pickupsKit ledger holds for this peer (require("pickupsKit.api").get(player, "coins")) and the three outfits of game.Blockhaven.OUTFITS, each with its price until it is owned. Ownership is read from game/avatar: the ids in its worn table, plus every id passed to its apply(player, id), which this component wraps.

Siblings it expects: the pickupsKit ledger (its PickupHUD is hidden while this HUD is up, so there is one coin counter in the corner, not two) and game/avatar for the wardrobe.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

nonstrict

pickups( ) → void

readCoins( ) → void

wardrobe( ) → void

game/avatar is the wardrobe: its `worn` table says what a player has on, and `apply` is the one call that changes it. Nothing else records a purchase, so this wraps `apply` to keep its own note of what was bought on this peer. The wrapper is marked on the module, so a live edit of game/avatar re-arms it and no second wrapper is ever stacked on the same table.

apply(player: ?, outfitId: ?) → void

argtypedescription
player?
outfitId?

readOwned( ) → void

canvas( ) → void

showWhich( ) → void

tuckAwayKitCounter( ) → void

pickupsKit's own coin counter keeps the same corner as this HUD, and its wallet is already on the screen above. One counter is the reference's arrangement, so the kit's is tucked away while Blockhaven's own HUD is up. It is hidden, never removed: the entity and its screen stay exactly as the coins module left them.

refresh(force: ?) → void

argtypedescription
force?

update(_dt: ?) → void

argtypedescription
_dt?

onCallback(id: ?, _data: ?) → void

argtypedescription
id?
_data?

onDestroy( ) → void

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

15items
▣
module · born here
❒asset
# Blockhaven The `Blockhaven` module defines the core constants and rules for the game world, including its color palette, city layout, outfit prices, and obstacle course parameters. It is read by every other module in the game to ensure consistency across the city, shop, and HUD, and is not meant to be modified by them.
▲ 0↑ born
▣
module · born here
❒asset
# screen Blockhaven's two screens, authored as widget trees: - **the title** — BLOCKHAVEN in chunky block lettering (one styled label per letter, so the word cascades in) over the jumping toy avatar and a shower of gold coins, with the tagline pill and one gold PLAY button over the live city; - **the HUD** — the coin count from the pickupsKit ledger and the three outfits of FITZ & CO., each with its price until it is bought and a tick after. `game/screen.module` builds the trees and nothing else: `Screen.titleTree({ W, H })` and `Screen.hudTree({ W, H, coins, delta, ownedCount, owned, outfits })`. Every size is worked out from the width the UI lays out on, so the same tree reads at a desktop window and at a phone-sized one. `Screen.build(env)` is what `scenes/main.scene/build.luau` calls. It spawns the `ScreenHost` entity and attaches `game.ScreenHost`, the component that registers both screens, polls the ledger and the wardrobe, and answers the PLAY callback — so the engine takes the screens down with that entity. Coin counts come from `require("pickupsKit.api").get(player, "coins")`. Outfits owned come from `require("game.avatar")`: the ids found in its `worn` table, plus every id that went through its `apply(player, id)` call — which this component wraps so a purchase shows on the HUD the moment it happens.
▲ 0↑ born
▣
module · born here
❒asset
# avatar The `avatar` module manages the player's appearance, including their body structure and outfits. It provides functions to compose the blocky avatar on a given player entity and to apply different outfits based on their IDs. Other game modules call `apply` to change a player's look, and `outfitOf` to query what a player is currently wearing.
▲ 0↑ born
backing path · game/ScreenHost.component

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.