create-threenative 0.2.7 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/agent-docs/references/capability-reference.md +177 -7
- package/capabilities.json +247 -4
- package/dist/index.js +6 -1
- package/dist/threenative.js +3 -2
- package/package.json +4 -4
- package/templates/action-rpg/package.json +1 -1
- package/templates/minimal/package.json +1 -1
- package/templates/platformer/package.json +1 -1
- package/templates/puzzle/package.json +1 -1
- package/templates/racing/package.json +1 -1
- package/templates/rain/.codex/config.toml +19 -0
- package/templates/rain/.cursor/mcp.json +32 -0
- package/templates/rain/.gemini/settings.json +32 -0
- package/templates/rain/.mcp.json +32 -0
- package/templates/rain/.vscode/mcp.json +36 -0
- package/templates/rain/.zed/settings.json +36 -0
- package/templates/rain/AGENTS.md +96 -0
- package/templates/rain/CLAUDE.md +98 -0
- package/templates/rain/assets/rain-loop.wav +0 -0
- package/templates/rain/assets/thunder.wav +0 -0
- package/templates/rain/assets/wind-loop.wav +0 -0
- package/templates/rain/index.html +18 -0
- package/templates/rain/kit.json +7 -0
- package/templates/rain/native-playtests/boot.playtest.json +13 -0
- package/templates/rain/native-playtests/lightning.playtest.json +173 -0
- package/templates/rain/opencode.json +41 -0
- package/templates/rain/package.json +56 -0
- package/templates/rain/playtests/auto-lightning-clear.playtest.json +66 -0
- package/templates/rain/playtests/auto-lightning.playtest.json +26 -0
- package/templates/rain/playtests/automation.playtest.json +133 -0
- package/templates/rain/playtests/cinematic.playtest.json +59 -0
- package/templates/rain/playtests/flash.playtest.json +27 -0
- package/templates/rain/playtests/fly.playtest.json +54 -0
- package/templates/rain/playtests/lightning.playtest.json +220 -0
- package/templates/rain/playtests/loading.playtest.json +57 -0
- package/templates/rain/playtests/paused.playtest.json +59 -0
- package/templates/rain/playtests/performance.playtest.json +22 -0
- package/templates/rain/playtests/reduced-motion.playtest.json +87 -0
- package/templates/rain/playtests/simulation.playtest.json +20 -0
- package/templates/rain/playtests/storm.playtest.json +150 -0
- package/templates/rain/playtests/survives.playtest.json +58 -0
- package/templates/rain/playtests/tiers.playtest.json +179 -0
- package/templates/rain/playtests/weather.playtest.json +77 -0
- package/templates/rain/public/favicon.svg +5 -0
- package/templates/rain/src/audio/storm.ts +314 -0
- package/templates/rain/src/game.ts +114 -0
- package/templates/rain/src/main.ts +15 -0
- package/templates/rain/src/render/bloom-shader.ts +65 -0
- package/templates/rain/src/render/camera.ts +160 -0
- package/templates/rain/src/render/clouds-shader.ts +242 -0
- package/templates/rain/src/render/clouds.ts +142 -0
- package/templates/rain/src/render/lighting.ts +39 -0
- package/templates/rain/src/render/lightning.ts +360 -0
- package/templates/rain/src/render/loading.ts +327 -0
- package/templates/rain/src/render/materials.ts +19 -0
- package/templates/rain/src/render/noise-volume.ts +159 -0
- package/templates/rain/src/render/palette.ts +18 -0
- package/templates/rain/src/render/post-shader.ts +178 -0
- package/templates/rain/src/render/postprocessing.ts +226 -0
- package/templates/rain/src/render/quality.ts +135 -0
- package/templates/rain/src/render/rain.ts +299 -0
- package/templates/rain/src/render/sky.ts +28 -0
- package/templates/rain/src/render/world-shader.ts +680 -0
- package/templates/rain/src/render/world.ts +146 -0
- package/templates/rain/src/render/worldEnvironment.ts +809 -0
- package/templates/rain/src/scenes/Boot.ts +334 -0
- package/templates/rain/src/state.ts +257 -0
- package/templates/rain/src/style.css +1160 -0
- package/templates/rain/src/ui/App.tsx +29 -0
- package/templates/rain/src/ui/GameUi.tsx +187 -0
- package/templates/rain/src/ui/Hud.tsx +327 -0
- package/templates/rain/src/ui/LoadingOverlay.tsx +46 -0
- package/templates/rain/src/ui/Menu.tsx +370 -0
- package/templates/rain/src/ui/automation.ts +60 -0
- package/templates/rain/src/ui/main.tsx +7 -0
- package/templates/rain/src/ui/tempest.ts +149 -0
- package/templates/rain/tailwind.config.ts +2 -0
- package/templates/rain/threenative.config.ts +66 -0
- package/templates/rain/tools/generate-shaders.mjs +656 -0
- package/templates/rain/tools/make-storm-audio.mjs +387 -0
- package/templates/rain/tools/storm-dsp.mjs +177 -0
- package/templates/rain/tools/tempest-bloom.frag +10 -0
- package/templates/rain/tools/tempest-clouds.frag +86 -0
- package/templates/rain/tools/tempest-post.frag +47 -0
- package/templates/rain/tools/tempest-world.frag +210 -0
- package/templates/rain/tools/verify-noise-volume.mjs +61 -0
- package/templates/rain/tsconfig.json +17 -0
- package/templates/rain/vite.config.ts +37 -0
- package/templates/rts/package.json +1 -1
- package/templates/runner/package.json +1 -1
- package/templates/sailing/package.json +1 -1
- package/templates/shooter/package.json +1 -1
- package/templates/snow/.codex/config.toml +19 -0
- package/templates/snow/.cursor/mcp.json +32 -0
- package/templates/snow/.gemini/settings.json +32 -0
- package/templates/snow/.mcp.json +32 -0
- package/templates/snow/.vscode/mcp.json +36 -0
- package/templates/snow/.zed/settings.json +36 -0
- package/templates/snow/AGENTS.md +88 -0
- package/templates/snow/CLAUDE.md +90 -0
- package/templates/snow/README.md +26 -0
- package/templates/snow/assets/crunch.wav +0 -0
- package/templates/snow/assets/wind.wav +0 -0
- package/templates/snow/index.html +12 -0
- package/templates/snow/kit.json +7 -0
- package/templates/snow/native-playtests/snow-physics.playtest.json +150 -0
- package/templates/snow/native-playtests/survives.playtest.json +47 -0
- package/templates/snow/opencode.json +41 -0
- package/templates/snow/package.json +58 -0
- package/templates/snow/playtests/footsteps.playtest.json +95 -0
- package/templates/snow/playtests/performance.playtest.json +36 -0
- package/templates/snow/playtests/snow-physics.playtest.json +154 -0
- package/templates/snow/playtests/survives.playtest.json +56 -0
- package/templates/snow/playtests/touch-controls.playtest.json +71 -0
- package/templates/snow/playtests/weather.playtest.json +119 -0
- package/templates/snow/public/favicon.svg +5 -0
- package/templates/snow/src/audio.ts +58 -0
- package/templates/snow/src/commands.ts +8 -0
- package/templates/snow/src/entities/Explorer.ts +279 -0
- package/templates/snow/src/game.ts +69 -0
- package/templates/snow/src/main.ts +15 -0
- package/templates/snow/src/render/bootPrint.ts +50 -0
- package/templates/snow/src/render/camera.ts +84 -0
- package/templates/snow/src/render/explorer.ts +321 -0
- package/templates/snow/src/render/lighting.ts +50 -0
- package/templates/snow/src/render/loading.ts +325 -0
- package/templates/snow/src/render/materials.ts +36 -0
- package/templates/snow/src/render/palette.ts +17 -0
- package/templates/snow/src/render/postprocessing.ts +44 -0
- package/templates/snow/src/render/props.ts +42 -0
- package/templates/snow/src/render/quality.ts +135 -0
- package/templates/snow/src/render/scenery.ts +244 -0
- package/templates/snow/src/render/sky.ts +57 -0
- package/templates/snow/src/render/snowSurface.ts +259 -0
- package/templates/snow/src/render/touch-controls.ts +143 -0
- package/templates/snow/src/render/weather.ts +279 -0
- package/templates/snow/src/render/worldEnvironment.ts +809 -0
- package/templates/snow/src/scenes/Boot.ts +12 -0
- package/templates/snow/src/scenes/Snow.ts +635 -0
- package/templates/snow/src/state.ts +46 -0
- package/templates/snow/src/style.css +143 -0
- package/templates/snow/src/terrain.ts +64 -0
- package/templates/snow/src/ui/App.tsx +15 -0
- package/templates/snow/src/ui/Controls.tsx +322 -0
- package/templates/snow/src/ui/GameUi.tsx +354 -0
- package/templates/snow/src/ui/icons.tsx +54 -0
- package/templates/snow/src/ui/main.tsx +7 -0
- package/templates/snow/tailwind.config.ts +2 -0
- package/templates/snow/threenative.config.ts +51 -0
- package/templates/snow/tsconfig.json +17 -0
- package/templates/snow/vite.config.ts +37 -0
- package/templates/starter/package.json +1 -1
- package/templates/tower-defense/package.json +1 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"acceptanceId": "prd-469-performance-snow",
|
|
3
|
+
"artifacts": {
|
|
4
|
+
"screenshots": "after"
|
|
5
|
+
},
|
|
6
|
+
"assert": {
|
|
7
|
+
"performance": {
|
|
8
|
+
"maxDrawCalls": 160,
|
|
9
|
+
"maxFrameMsP95": 33,
|
|
10
|
+
"maxTriangles": 1000000,
|
|
11
|
+
"minFps": 30
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"name": "production-performance",
|
|
15
|
+
"schemaVersion": 1,
|
|
16
|
+
"steps": [
|
|
17
|
+
{
|
|
18
|
+
"kind": "input",
|
|
19
|
+
"press": "ArrowUp",
|
|
20
|
+
"holdTicks": 60,
|
|
21
|
+
"release": true
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"kind": "wait",
|
|
25
|
+
"waitTicks": 600,
|
|
26
|
+
"release": true
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"subject": "player",
|
|
30
|
+
"target": "web",
|
|
31
|
+
"viewport": {
|
|
32
|
+
"height": 1080,
|
|
33
|
+
"width": 1920
|
|
34
|
+
},
|
|
35
|
+
"warmupFrames": 60
|
|
36
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "snow-physics",
|
|
3
|
+
"schemaVersion": 1,
|
|
4
|
+
"target": "web",
|
|
5
|
+
"viewport": {
|
|
6
|
+
"width": 1280,
|
|
7
|
+
"height": 720
|
|
8
|
+
},
|
|
9
|
+
"warmupFrames": 40,
|
|
10
|
+
"subject": "player",
|
|
11
|
+
"steps": [
|
|
12
|
+
{
|
|
13
|
+
"kind": "wait",
|
|
14
|
+
"label": "boot",
|
|
15
|
+
"waitTicks": 20,
|
|
16
|
+
"release": true
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"kind": "input",
|
|
20
|
+
"label": "hands-off",
|
|
21
|
+
"press": "KeyP",
|
|
22
|
+
"holdTicks": 2,
|
|
23
|
+
"release": true
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"kind": "wait",
|
|
27
|
+
"label": "standing",
|
|
28
|
+
"waitTicks": 30,
|
|
29
|
+
"release": true
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"kind": "input",
|
|
33
|
+
"label": "drop",
|
|
34
|
+
"press": "KeyF",
|
|
35
|
+
"holdTicks": 1,
|
|
36
|
+
"release": true
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"kind": "wait",
|
|
40
|
+
"label": "falling",
|
|
41
|
+
"waitTicks": 10,
|
|
42
|
+
"release": true
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"kind": "wait",
|
|
46
|
+
"label": "settled",
|
|
47
|
+
"waitTicks": 240,
|
|
48
|
+
"release": true
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"kind": "input",
|
|
52
|
+
"label": "push",
|
|
53
|
+
"press": "KeyG",
|
|
54
|
+
"holdTicks": 1,
|
|
55
|
+
"release": true
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"kind": "wait",
|
|
59
|
+
"label": "rolled",
|
|
60
|
+
"waitTicks": 200,
|
|
61
|
+
"release": true
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"assert": {
|
|
65
|
+
"components": [
|
|
66
|
+
{
|
|
67
|
+
"entity": "ball",
|
|
68
|
+
"component": "airborne",
|
|
69
|
+
"atSteps": [
|
|
70
|
+
{
|
|
71
|
+
"label": "falling",
|
|
72
|
+
"equals": true
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"label": "settled",
|
|
76
|
+
"equals": false
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"allowTrivial": "The drop must start in the air and end on the snow: a ball that never leaves the surface proves nothing about airborne contacts."
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"entity": "ball",
|
|
83
|
+
"component": "settled",
|
|
84
|
+
"atSteps": [
|
|
85
|
+
{
|
|
86
|
+
"label": "settled",
|
|
87
|
+
"equals": true
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"allowTrivial": "Settled means the solved sphere's underside sits within 0.02 m of the surface it pressed, and that surface is at least 2 cm below fresh powder."
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"entity": "ball",
|
|
94
|
+
"component": "airborneLoads",
|
|
95
|
+
"equals": 0,
|
|
96
|
+
"allowTrivial": "No load may reach the snow while the ball is more than 5 cm above it; a contact read off an airborne body is a phantom."
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"entity": "ball",
|
|
100
|
+
"component": "reach",
|
|
101
|
+
"gte": 0.5,
|
|
102
|
+
"allowTrivial": "The push must carry the solved body half a metre or more through fresh powder; how far depends on the slope it was pushed up, so this is a floor, not a distance."
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"entity": "ball",
|
|
106
|
+
"component": "rollRatio",
|
|
107
|
+
"gte": 0.6,
|
|
108
|
+
"lte": 1.6,
|
|
109
|
+
"allowTrivial": "Turn times radius over the ground covered: a rolling ball reads near 1 (a ball carving its own trench can over-spin as it slows), a sliding or copied transform reads near 0."
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"entity": "ball",
|
|
113
|
+
"component": "trackGaps",
|
|
114
|
+
"equals": 0,
|
|
115
|
+
"allowTrivial": "Every recorded point of the ball's path must sit in pressed snow: the track is connected, not a row of holes."
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"entity": "ball",
|
|
119
|
+
"component": "trackSamples",
|
|
120
|
+
"gte": 5,
|
|
121
|
+
"allowTrivial": "The connected-track check needs a path to check: five or more points ten centimetres apart."
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"entity": "snow",
|
|
125
|
+
"component": "colliderError",
|
|
126
|
+
"lte": 0.001,
|
|
127
|
+
"allowTrivial": "The collider the next step uses is the canonical surface within a millimetre."
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"entity": "snow",
|
|
131
|
+
"component": "renderError",
|
|
132
|
+
"lte": 0.001,
|
|
133
|
+
"allowTrivial": "The drawn snow is the canonical surface within a millimetre."
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"entity": "snow",
|
|
137
|
+
"component": "loadProvenance",
|
|
138
|
+
"equals": "solver-impulse-per-step",
|
|
139
|
+
"allowTrivial": "Snow load is a solver estimate and must say so."
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"entity": "snow",
|
|
143
|
+
"component": "version",
|
|
144
|
+
"gte": 2,
|
|
145
|
+
"changed": true,
|
|
146
|
+
"allowTrivial": "The surface must actually change during the run."
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
"diagnostics": {
|
|
150
|
+
"noConsoleErrors": true,
|
|
151
|
+
"runtimeReady": true
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "survives",
|
|
3
|
+
"target": "web",
|
|
4
|
+
"schemaVersion": 1,
|
|
5
|
+
"viewport": {
|
|
6
|
+
"width": 1280,
|
|
7
|
+
"height": 720
|
|
8
|
+
},
|
|
9
|
+
"warmupFrames": 10,
|
|
10
|
+
"subject": "player",
|
|
11
|
+
"steps": [
|
|
12
|
+
{
|
|
13
|
+
"kind": "input",
|
|
14
|
+
"label": "hands-off",
|
|
15
|
+
"press": "KeyP",
|
|
16
|
+
"holdTicks": 2,
|
|
17
|
+
"release": true
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"kind": "input",
|
|
21
|
+
"label": "walk-forward",
|
|
22
|
+
"press": "ArrowUp",
|
|
23
|
+
"holdTicks": 60,
|
|
24
|
+
"release": true
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"kind": "wait",
|
|
28
|
+
"label": "settle",
|
|
29
|
+
"waitTicks": 10,
|
|
30
|
+
"release": true
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"assert": {
|
|
34
|
+
"diagnostics": {
|
|
35
|
+
"noConsoleErrors": true,
|
|
36
|
+
"noNetworkErrors": true,
|
|
37
|
+
"noRuntimeDiagnostics": true,
|
|
38
|
+
"runtimeReady": true
|
|
39
|
+
},
|
|
40
|
+
"movement": {
|
|
41
|
+
"entity": "player",
|
|
42
|
+
"minDistance": 0.5
|
|
43
|
+
},
|
|
44
|
+
"visual": [
|
|
45
|
+
{
|
|
46
|
+
"region": {
|
|
47
|
+
"x": 0,
|
|
48
|
+
"y": 0,
|
|
49
|
+
"width": 1280,
|
|
50
|
+
"height": 720,
|
|
51
|
+
"minNonblankPixelRatio": 0.01
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "snow-touch-controls",
|
|
3
|
+
"schemaVersion": 1,
|
|
4
|
+
"target": "web",
|
|
5
|
+
"viewport": {
|
|
6
|
+
"width": 390,
|
|
7
|
+
"height": 844
|
|
8
|
+
},
|
|
9
|
+
"warmupFrames": 10,
|
|
10
|
+
"subject": "player",
|
|
11
|
+
"steps": [
|
|
12
|
+
{
|
|
13
|
+
"kind": "input",
|
|
14
|
+
"label": "movement-anchor",
|
|
15
|
+
"pointers": [
|
|
16
|
+
{
|
|
17
|
+
"id": 7,
|
|
18
|
+
"x": 0.25,
|
|
19
|
+
"y": 0.82
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"holdTicks": 2,
|
|
23
|
+
"release": false
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"kind": "input",
|
|
27
|
+
"label": "walk-forward",
|
|
28
|
+
"pointers": [
|
|
29
|
+
{
|
|
30
|
+
"id": 7,
|
|
31
|
+
"x": 0.25,
|
|
32
|
+
"y": 0.72
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"holdTicks": 120,
|
|
36
|
+
"release": true
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"kind": "wait",
|
|
40
|
+
"label": "settled",
|
|
41
|
+
"waitTicks": 10,
|
|
42
|
+
"release": true
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"assert": {
|
|
46
|
+
"diagnostics": {
|
|
47
|
+
"noConsoleErrors": true,
|
|
48
|
+
"noNetworkErrors": true,
|
|
49
|
+
"noRuntimeDiagnostics": true,
|
|
50
|
+
"runtimeReady": true
|
|
51
|
+
},
|
|
52
|
+
"movement": {
|
|
53
|
+
"entity": "player",
|
|
54
|
+
"minDistance": 0.5
|
|
55
|
+
},
|
|
56
|
+
"resources": [
|
|
57
|
+
{
|
|
58
|
+
"id": "state",
|
|
59
|
+
"path": "autoExplore",
|
|
60
|
+
"equals": false
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"visibility": [
|
|
64
|
+
{
|
|
65
|
+
"entity": "touch-controls",
|
|
66
|
+
"present": true,
|
|
67
|
+
"allowTrivial": "Touch-primary lanes keep the movement stick visible while the walk proves it is live."
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "snow-weather",
|
|
3
|
+
"schemaVersion": 1,
|
|
4
|
+
"target": "web",
|
|
5
|
+
"viewport": {
|
|
6
|
+
"width": 1280,
|
|
7
|
+
"height": 720
|
|
8
|
+
},
|
|
9
|
+
"warmupFrames": 20,
|
|
10
|
+
"subject": "player",
|
|
11
|
+
"steps": [
|
|
12
|
+
{
|
|
13
|
+
"kind": "input",
|
|
14
|
+
"label": "hands-off",
|
|
15
|
+
"press": "KeyP",
|
|
16
|
+
"holdTicks": 2,
|
|
17
|
+
"release": true
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"kind": "wait",
|
|
21
|
+
"label": "calm",
|
|
22
|
+
"waitTicks": 20,
|
|
23
|
+
"release": true
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"kind": "input",
|
|
27
|
+
"label": "blizzard",
|
|
28
|
+
"press": "KeyB",
|
|
29
|
+
"holdTicks": 1,
|
|
30
|
+
"release": true
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"kind": "wait",
|
|
34
|
+
"label": "storm",
|
|
35
|
+
"waitTicks": 300,
|
|
36
|
+
"release": true
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"kind": "input",
|
|
40
|
+
"label": "compaction",
|
|
41
|
+
"press": "KeyV",
|
|
42
|
+
"holdTicks": 1,
|
|
43
|
+
"release": true
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"kind": "input",
|
|
47
|
+
"label": "reset",
|
|
48
|
+
"press": "KeyR",
|
|
49
|
+
"holdTicks": 1,
|
|
50
|
+
"release": true
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"kind": "wait",
|
|
54
|
+
"label": "fresh",
|
|
55
|
+
"waitTicks": 20,
|
|
56
|
+
"release": true
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"assert": {
|
|
60
|
+
"diagnostics": {
|
|
61
|
+
"noConsoleErrors": true,
|
|
62
|
+
"noNetworkErrors": true,
|
|
63
|
+
"noRuntimeDiagnostics": true,
|
|
64
|
+
"runtimeReady": true
|
|
65
|
+
},
|
|
66
|
+
"components": [
|
|
67
|
+
{
|
|
68
|
+
"entity": "weather",
|
|
69
|
+
"component": "storm",
|
|
70
|
+
"gte": 0.6,
|
|
71
|
+
"allowTrivial": "Five seconds after B the blizzard has mostly built: the eased storm level passes 0.6."
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"entity": "weather",
|
|
75
|
+
"component": "wind",
|
|
76
|
+
"gte": 4,
|
|
77
|
+
"allowTrivial": "A blizzard blows at several metres a second, gusts included."
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"entity": "snow",
|
|
81
|
+
"component": "trailPressed",
|
|
82
|
+
"atSteps": [
|
|
83
|
+
{
|
|
84
|
+
"label": "calm",
|
|
85
|
+
"equals": true
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"label": "fresh",
|
|
89
|
+
"equals": false
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"allowTrivial": "The arrival trail is in the snow at the start and gone after R clears every footprint."
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
"resources": [
|
|
96
|
+
{
|
|
97
|
+
"id": "state",
|
|
98
|
+
"path": "blizzard",
|
|
99
|
+
"equals": true
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"id": "state",
|
|
103
|
+
"path": "compaction",
|
|
104
|
+
"equals": true
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
"visual": [
|
|
108
|
+
{
|
|
109
|
+
"region": {
|
|
110
|
+
"x": 0,
|
|
111
|
+
"y": 0,
|
|
112
|
+
"width": 1280,
|
|
113
|
+
"height": 720,
|
|
114
|
+
"minNonblankPixelRatio": 0.01
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
|
2
|
+
<rect width="64" height="64" rx="14" fill="#061b2b"/>
|
|
3
|
+
<path d="M10 45h44M17 45l16-30 14 30M25 30h17" fill="none" stroke="#ffd27a" stroke-linecap="round" stroke-linejoin="round" stroke-width="5"/>
|
|
4
|
+
<path d="M12 51c8-4 16 4 24 0s16 4 16 0" fill="none" stroke="#6fe8ff" stroke-linecap="round" stroke-width="4"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { AudioBus } from "@threenative/core";
|
|
2
|
+
import type { Audio, Object3D } from "three";
|
|
3
|
+
import type { IFootstep } from "./entities/Explorer.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Boot crunch and a wind bed through one `AudioBus`. Both clips in `assets/` are generated
|
|
7
|
+
* noise — a bandpass sweep for the crunch, filtered brown noise for the wind — so swap either
|
|
8
|
+
* file for a recording without touching this code. Muted means the bus level is zero; the wind
|
|
9
|
+
* keeps looping underneath so unmuting never restarts it mid-gust.
|
|
10
|
+
*/
|
|
11
|
+
export class SnowAudio {
|
|
12
|
+
readonly bus: AudioBus;
|
|
13
|
+
#crunch: AudioBuffer | undefined;
|
|
14
|
+
#wind: Audio | undefined;
|
|
15
|
+
#muted = true;
|
|
16
|
+
|
|
17
|
+
constructor(camera: Object3D, load: (name: string) => Promise<AudioBuffer>) {
|
|
18
|
+
this.bus = new AudioBus({ camera });
|
|
19
|
+
this.bus.setVolume(0);
|
|
20
|
+
void load("crunch.wav")
|
|
21
|
+
.then((buffer) => {
|
|
22
|
+
this.#crunch = buffer;
|
|
23
|
+
})
|
|
24
|
+
.catch(() => undefined);
|
|
25
|
+
void load("wind.wav")
|
|
26
|
+
.then((buffer) => {
|
|
27
|
+
this.#wind = this.bus.play(buffer, { cue: "wind", loop: true, volume: 0 });
|
|
28
|
+
})
|
|
29
|
+
.catch(() => undefined);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
get muted(): boolean {
|
|
33
|
+
return this.#muted;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
setMuted(muted: boolean): void {
|
|
37
|
+
this.#muted = muted;
|
|
38
|
+
this.bus.setVolume(muted ? 0 : 1, 0.2);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
footstep(step: IFootstep): void {
|
|
42
|
+
if (this.#muted || this.#crunch === undefined || step.penetration <= 0) return;
|
|
43
|
+
this.bus.play(this.#crunch, {
|
|
44
|
+
cue: "crunch",
|
|
45
|
+
detune: (Math.random() - 0.5) * 400,
|
|
46
|
+
volume: Math.min(1, 0.42 + step.penetration * 2),
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** The wind bed follows the live wind and swells with the storm. */
|
|
51
|
+
update(wind: number, storm: number): void {
|
|
52
|
+
this.#wind?.setVolume(Math.min(1, 0.12 + storm * 0.55 + wind * 0.01));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
dispose(): void {
|
|
56
|
+
this.bus.dispose();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One-shot actions from the HUD. Sliders and toggles are state; these are verbs, so the UI pushes
|
|
3
|
+
* them here and the scene drains the queue on its next fixed step — the same functions a key
|
|
4
|
+
* press calls, so the keyboard and the panel can never disagree.
|
|
5
|
+
*/
|
|
6
|
+
export type Command = "reset" | "drop" | "kick" | "view" | "auto" | "blizzard" | "mute";
|
|
7
|
+
|
|
8
|
+
export const commands: Command[] = [];
|