Valley
Painted Valley's main.js on Zero: the scene driver on the `valley` entity. Bakes the land's maps, brings up the frame, builds the parts in the original's order, hands them the camera, walker, wind and clock every frame, and keeps the hour (T, 1-4, comma, period, 0) and the paint…
Valley
Painted Valley's main.js on Zero: the scene driver on the valley entity. Bakes the land's maps, brings up the frame, builds the parts in the original's order, hands them the camera, walker, wind and clock every frame, and keeps the hour (T, 1-4, comma, period, 0) and the paint finish (P).
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2Valley — Painted Valley's main.js on Zero (blendi/painted-valley on Patch, MIT): the scene's driver. One sits on the scene's `valley` entity, a plain local entity: every peer builds its own copy of the valley, which is the same everywhere because it is made from code. It * bakes the field's maps (core) and brings up the frame (paint finish, ink, bloom, the painter's curve), * builds the parts in main.js's order: the sky (and the hour's light), the meadow, the far land, the village with its trees and tarn, the wanderer, * every frame hands the parts the camera, the walker, the wind and the clock (field.update, sky.update, ...), * keeps the hour: the afternoon you start in is sunset twenty minutes later; T and 1 to 4 pick a time of day and hold it there, 0 lets it pass again, `,` and `.` nudge it; P takes the paint finish off and on. The time of day and the paint are each peer's own, as they are each viewer's own in the original.
loadParts( ) → void
The parts, in main.js's order. Each is `paintedValley.<part>.<part>`, returning { name, build, update?, setHour?, destroy? } (PORTING.md). A part is listed here once its module exists in the world.
add(ok: boolean, mod: any, name: string) → void
| arg | type | description |
|---|---|---|
| ok | boolean | |
| mod | any | |
| name | string |
sunset( ) → number
noteTree(text: string, opacity: number) → any
| arg | type | description |
|---|---|---|
| text | string | |
| opacity | number |
drawNote( ) → void
note(text: string) → void
| arg | type | description |
|---|---|---|
| text | string |
readCamera( ) → void
The camera this peer draws with: its position and the way it looks, from the renderer's main view.
unproject(x: number, y: number, z: number) → void
| arg | type | description |
|---|---|---|
| x | number | |
| y | number | |
| z | number |
setHour(hour: number, quick: boolean?) → void
| arg | type | description |
|---|---|---|
| hour | number | |
| quick | boolean? |
pickTime(index: number) → void
Goes to one of the times of day and holds it there.
| arg | type | description |
|---|---|---|
| index | number |
setWind(speed: number) → void
| arg | type | description |
|---|---|---|
| speed | number |
collectTags( ) → void
tagsChanged( ) → boolean
dropValleyDraws( ) → number
Every instanced draw the valley makes reads a transform buffer named pv_*. A part that loses its handles (its module reloaded, its build interrupted) would otherwise leave its old draws drawing beside the new ones: drop them all before a build and after a destroy, so a rebuild never stacks a second valley on the first.
build( ) → void
tick(dt: number, playing: boolean) → void
| arg | type | description |
|---|---|---|
| dt | number | |
| playing | boolean |
awake( ) → void
setHour(h: number) → void
| arg | type | description |
|---|---|---|
| h | number |
start( ) → void
update(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
editorUpdate(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
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.
Showing up to 3 levels deep. Open a part to see what it holds further down.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ 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".
Scoped to this part · feeds back into the world's score.