castle-web-cli 0.4.129 → 0.4.130
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/dist/agent-prompts.js +4 -4
- package/dist/filesChanged.d.ts +2 -0
- package/dist/filesChanged.js +6 -2
- package/dist/ide.js +15 -4
- package/dist/importBrowse.js +1 -0
- package/dist/index.js +10 -4
- package/dist/init.js +63 -15
- package/dist/native/loop.js +1 -1
- package/dist/native/tools.js +1 -1
- package/dist/serve.d.ts +1 -0
- package/dist/serve.js +20 -1
- package/dist/shell/assets/index-BpOLUyVO.js +441 -0
- package/dist/shell/assets/{index-CAq6f9B5.css → index-D6K-0YDB.css} +1 -1
- package/dist/shell/index.html +2 -2
- package/kits/physics-2d/CLAUDE.md +9 -10
- package/kits/physics-2d/castle.json +1 -1
- package/kits/physics-2d/editors/PlayOnly.jsx +15 -6
- package/kits/physics-2d/editors/PxArtEditor.jsx +95 -31
- package/kits/physics-2d/editors/SceneEditor.jsx +5 -5
- package/kits/physics-2d/editors/SingleEditor.jsx +37 -8
- package/kits/physics-2d/editors/StyleEditor.jsx +7 -4
- package/kits/physics-2d/editors/pixelEditorChrome.jsx +7 -7
- package/kits/physics-2d/editors/pixelInspector.jsx +13 -7
- package/kits/physics-2d/editors/pxArtTimeline.jsx +29 -11
- package/kits/physics-2d/editors/pxArtTimeline.module.css +11 -0
- package/kits/physics-2d/engine/blueprint.js +15 -3
- package/kits/physics-2d/engine/liveReload.js +33 -21
- package/kits/physics-2d/engine/systemRegistry.js +1 -1
- package/kits/physics-2d/engine/ui.jsx +2 -2
- package/kits/physics-2d/engine/ui.module.css +42 -0
- package/kits/physics-3d/CLAUDE.md +109 -0
- package/kits/physics-3d/behaviors/Body.jsx +51 -0
- package/kits/physics-3d/behaviors/Door.jsx +31 -0
- package/kits/physics-3d/behaviors/Lookable.jsx +11 -0
- package/kits/physics-3d/behaviors/Model.jsx +14 -0
- package/kits/physics-3d/behaviors/Pickup.jsx +39 -0
- package/kits/physics-3d/behaviors/Player.jsx +172 -0
- package/kits/physics-3d/behaviors/Portal.jsx +19 -0
- package/kits/physics-3d/behaviors/Shape.jsx +75 -0
- package/kits/physics-3d/behaviors/Solid.jsx +11 -0
- package/kits/physics-3d/behaviors/Transform.jsx +24 -0
- package/kits/physics-3d/blueprints/barrel.scene +15 -0
- package/kits/physics-3d/blueprints/crate.scene +29 -0
- package/kits/physics-3d/blueprints/door.scene +35 -0
- package/kits/physics-3d/blueprints/gem.scene +26 -0
- package/kits/physics-3d/blueprints/pillar.scene +25 -0
- package/kits/physics-3d/blueprints/platform.scene +23 -0
- package/kits/physics-3d/blueprints/player.scene +29 -0
- package/kits/physics-3d/blueprints/portal.scene +21 -0
- package/kits/physics-3d/blueprints/rock.scene +14 -0
- package/kits/physics-3d/blueprints/statue.scene +26 -0
- package/kits/physics-3d/blueprints/tree.scene +14 -0
- package/kits/physics-3d/blueprints/wall.scene +26 -0
- package/kits/{basic-2d → physics-3d}/castle.json +23 -5
- package/kits/physics-3d/docs/pxmodel-format.md +111 -0
- package/kits/physics-3d/drawings/crate.pxart +26 -0
- package/kits/physics-3d/drawings/door-edge.pxart +26 -0
- package/kits/physics-3d/drawings/door.pxart +27 -0
- package/kits/physics-3d/drawings/face.pxart +26 -0
- package/kits/physics-3d/drawings/floor.pxart +27 -0
- package/kits/physics-3d/drawings/platform.pxart +27 -0
- package/kits/physics-3d/drawings/statue.pxart +27 -0
- package/kits/physics-3d/drawings/wall.pxart +27 -0
- package/kits/physics-3d/engine3d/PlayOnly3D.jsx +32 -0
- package/kits/physics-3d/engine3d/PxModelEditor.jsx +619 -0
- package/kits/physics-3d/engine3d/Scene3DEditor.jsx +618 -0
- package/kits/physics-3d/engine3d/Scene3DPlayer.jsx +309 -0
- package/kits/physics-3d/engine3d/editor3dData.js +114 -0
- package/kits/physics-3d/engine3d/editor3dInspector.jsx +404 -0
- package/kits/physics-3d/engine3d/editorChrome.jsx +218 -0
- package/kits/physics-3d/engine3d/editorWorld.js +249 -0
- package/kits/physics-3d/engine3d/materials.js +174 -0
- package/kits/physics-3d/engine3d/meshops.js +123 -0
- package/kits/physics-3d/engine3d/modelEditorWorld.js +439 -0
- package/kits/physics-3d/engine3d/modelFiles.js +139 -0
- package/kits/physics-3d/engine3d/pxmodel.js +265 -0
- package/kits/physics-3d/engine3d/thumbnails.js +137 -0
- package/kits/physics-3d/engine3d/world3d.js +216 -0
- package/kits/{basic-2d → physics-3d}/eslint.config.js +10 -25
- package/kits/physics-3d/index.html +20 -0
- package/kits/physics-3d/main.jsx +30 -0
- package/kits/physics-3d/models/barrel.pxmodel +10 -0
- package/kits/physics-3d/models/player.pxmodel +222 -0
- package/kits/physics-3d/models/rock.pxmodel +30 -0
- package/kits/physics-3d/models/tree.pxmodel +10 -0
- package/kits/{basic-2d → physics-3d}/package-lock.json +140 -119
- package/kits/{basic-2d → physics-3d}/package.json +11 -9
- package/kits/{basic-2d → physics-3d}/pnpm-lock.yaml +162 -137
- package/kits/physics-3d/scenes/main.scene +414 -0
- package/kits/physics-3d/scenes/model-lab.scene +127 -0
- package/kits/physics-3d/systems/physics3d.js +356 -0
- package/package.json +5 -2
- package/dist/shell/assets/index-DKu9ejyh.js +0 -436
- package/kits/basic-2d/CLAUDE.md +0 -221
- package/kits/basic-2d/behaviors/Camera.jsx +0 -43
- package/kits/basic-2d/behaviors/Collider.jsx +0 -213
- package/kits/basic-2d/behaviors/Layout.jsx +0 -53
- package/kits/basic-2d/behaviors/Sprite.jsx +0 -357
- package/kits/basic-2d/behaviors/tint.js +0 -47
- package/kits/basic-2d/blueprints/cauldron.scene +0 -20
- package/kits/basic-2d/docs/pxart-format.md +0 -377
- package/kits/basic-2d/drawings/cauldron.pxart +0 -113
- package/kits/basic-2d/editors/BlueprintLibrary.jsx +0 -270
- package/kits/basic-2d/editors/ErrorBoundary.jsx +0 -59
- package/kits/basic-2d/editors/PlayOnly.jsx +0 -31
- package/kits/basic-2d/editors/PxArtEditor.jsx +0 -1092
- package/kits/basic-2d/editors/SceneEditor.jsx +0 -1780
- package/kits/basic-2d/editors/SelectionOverlay.jsx +0 -909
- package/kits/basic-2d/editors/SingleEditor.jsx +0 -122
- package/kits/basic-2d/editors/behaviorRegistry.js +0 -34
- package/kits/basic-2d/editors/editorHistory.js +0 -157
- package/kits/basic-2d/editors/inspectorSheet.js +0 -13
- package/kits/basic-2d/editors/pixelCanvas.js +0 -11
- package/kits/basic-2d/editors/pixelEditorChrome.jsx +0 -74
- package/kits/basic-2d/editors/pixelGeometry.js +0 -140
- package/kits/basic-2d/editors/pixelInspector.jsx +0 -633
- package/kits/basic-2d/editors/pxArtEditorModel.js +0 -732
- package/kits/basic-2d/editors/pxArtPlayback.js +0 -92
- package/kits/basic-2d/editors/pxArtTimeline.jsx +0 -752
- package/kits/basic-2d/editors/pxArtTimeline.module.css +0 -506
- package/kits/basic-2d/editors/pxArtTools.js +0 -232
- package/kits/basic-2d/editors/useArtboardFit.js +0 -105
- package/kits/basic-2d/engine/ScenePlayer.jsx +0 -209
- package/kits/basic-2d/engine/SceneUI.jsx +0 -59
- package/kits/basic-2d/engine/assets.js +0 -15
- package/kits/basic-2d/engine/autoInspector.jsx +0 -70
- package/kits/basic-2d/engine/behaviorExtensions.js +0 -32
- package/kits/basic-2d/engine/blueprint.js +0 -557
- package/kits/basic-2d/engine/collider.js +0 -200
- package/kits/basic-2d/engine/files.js +0 -141
- package/kits/basic-2d/engine/liveReload.js +0 -88
- package/kits/basic-2d/engine/pxart.js +0 -1032
- package/kits/basic-2d/engine/pxartSmooth.js +0 -222
- package/kits/basic-2d/engine/scene.js +0 -696
- package/kits/basic-2d/engine/spriteGeometry.js +0 -32
- package/kits/basic-2d/engine/systemRegistry.js +0 -16
- package/kits/basic-2d/engine/ui.jsx +0 -695
- package/kits/basic-2d/engine/ui.module.css +0 -2287
- package/kits/basic-2d/index.html +0 -24
- package/kits/basic-2d/main.jsx +0 -24
- package/kits/basic-2d/scenes/main.scene +0 -16
- package/kits/basic-2d/scripts/draw.mjs +0 -121
- /package/kits/{basic-2d → physics-3d}/.prettierrc +0 -0
- /package/kits/{basic-2d → physics-3d}/vite.config.js +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Wall",
|
|
3
|
+
"actors": [
|
|
4
|
+
{
|
|
5
|
+
"components": {
|
|
6
|
+
"Transform": {
|
|
7
|
+
"y": 1
|
|
8
|
+
},
|
|
9
|
+
"Shape": {
|
|
10
|
+
"kind": "box",
|
|
11
|
+
"width": 4,
|
|
12
|
+
"height": 2,
|
|
13
|
+
"depth": 0.4,
|
|
14
|
+
"art": "drawings/wall.pxart",
|
|
15
|
+
"artRepeat": [
|
|
16
|
+
2,
|
|
17
|
+
1
|
|
18
|
+
],
|
|
19
|
+
"color": "#45444f",
|
|
20
|
+
"roughness": 0.9
|
|
21
|
+
},
|
|
22
|
+
"Solid": {}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
+
"title": "physics-3d",
|
|
2
3
|
"editor": {
|
|
3
4
|
"initialPanels": [
|
|
4
5
|
{
|
|
@@ -20,9 +21,11 @@
|
|
|
20
21
|
"hiddenPaths": [],
|
|
21
22
|
"visiblePaths": [
|
|
22
23
|
"drawings/**",
|
|
24
|
+
"models/**",
|
|
23
25
|
"scenes/**",
|
|
24
26
|
"blueprints/**",
|
|
25
|
-
"behaviors/**"
|
|
27
|
+
"behaviors/**",
|
|
28
|
+
"assets/**"
|
|
26
29
|
],
|
|
27
30
|
"fileTypes": [
|
|
28
31
|
{
|
|
@@ -41,6 +44,14 @@
|
|
|
41
44
|
"editor": "kit",
|
|
42
45
|
"data": true
|
|
43
46
|
},
|
|
47
|
+
{
|
|
48
|
+
"ext": ".pxmodel",
|
|
49
|
+
"label": "Model",
|
|
50
|
+
"new": "New model",
|
|
51
|
+
"icon": "clone",
|
|
52
|
+
"editor": "kit",
|
|
53
|
+
"data": true
|
|
54
|
+
},
|
|
44
55
|
{
|
|
45
56
|
"ext": ".jsx",
|
|
46
57
|
"label": "Behavior",
|
|
@@ -50,8 +61,15 @@
|
|
|
50
61
|
],
|
|
51
62
|
"defaultPlayFile": "scenes/main.scene"
|
|
52
63
|
},
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
64
|
+
"imports": {
|
|
65
|
+
"castle.physics-2d": {
|
|
66
|
+
"deckId": "ckRZGFW4iPrx",
|
|
67
|
+
"version": "2026-08-14T21:20:31.152Z"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"main": "main.jsx",
|
|
71
|
+
"autoUpdateWhenImported": true,
|
|
72
|
+
"deckId": "JH0SclbPVP0y",
|
|
73
|
+
"cardId": "eXfAaUdbSU5A",
|
|
74
|
+
"publishedVersion": "2026-08-21T22:11:54.424Z"
|
|
57
75
|
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# `.pxmodel` 3D Model Format (physics-3d kit)
|
|
2
|
+
|
|
3
|
+
A `.pxmodel` is the 3d analog of `.pxart`: a small, hand- and agent-editable
|
|
4
|
+
JSON file describing a model as a list of named PARTS. A part is usually a
|
|
5
|
+
primitive (legible, diffable, easy for an agent to patch); when a form needs
|
|
6
|
+
more than primitives, a part can be an editable polygon MESH (`kind:
|
|
7
|
+
"mesh"`) -- explicit vertices and quad-dominant faces, still plain JSON.
|
|
8
|
+
Files live under `models/` and are edited in the kit's model editor (or as
|
|
9
|
+
JSON).
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"format": "pxmodel",
|
|
14
|
+
"name": "Barrel",
|
|
15
|
+
"parts": [
|
|
16
|
+
{
|
|
17
|
+
"id": "body",
|
|
18
|
+
"kind": "cylinder",
|
|
19
|
+
"radius": 0.4,
|
|
20
|
+
"height": 0.9,
|
|
21
|
+
"position": [0, 0.45, 0],
|
|
22
|
+
"art": "drawings/platform.pxart"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "rim",
|
|
26
|
+
"parent": "body",
|
|
27
|
+
"kind": "cylinder",
|
|
28
|
+
"radius": 0.42,
|
|
29
|
+
"height": 0.06,
|
|
30
|
+
"position": [0, 0.42, 0],
|
|
31
|
+
"color": "#391f21"
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## The model
|
|
38
|
+
|
|
39
|
+
- `format`: always `"pxmodel"`.
|
|
40
|
+
- `name`: display name.
|
|
41
|
+
- `parts`: ordered array of parts. Order is draw/authoring order only;
|
|
42
|
+
hierarchy comes from `parent`.
|
|
43
|
+
|
|
44
|
+
The model's own space is up to the author; the convention is **feet (or base)
|
|
45
|
+
at y = 0**, 1 unit = 1 meter, facing **+z**. The `Model` behavior places the
|
|
46
|
+
model at the actor's Transform (offset by `Model.yOffset`, e.g. `-0.7` to put
|
|
47
|
+
feet under a capsule whose center is the Transform).
|
|
48
|
+
|
|
49
|
+
## A part
|
|
50
|
+
|
|
51
|
+
Identity and hierarchy:
|
|
52
|
+
|
|
53
|
+
- `id` -- unique string. Part ids are also animation hooks (below).
|
|
54
|
+
- `parent` -- another part's id. A child's `position`/`rotation` are relative
|
|
55
|
+
to its parent's pivot. Omit for a root part.
|
|
56
|
+
|
|
57
|
+
Placement (all optional, defaulting to zero):
|
|
58
|
+
|
|
59
|
+
- `position: [x, y, z]` -- the part's PIVOT, in parent (or model) space.
|
|
60
|
+
Rotations happen about this point.
|
|
61
|
+
- `rotation: [x, y, z]` -- degrees.
|
|
62
|
+
- `offset: [x, y, z]` -- the mesh's center relative to the pivot. A leg whose
|
|
63
|
+
pivot is the hip has `offset: [0, -0.22, 0]` so it swings from the top.
|
|
64
|
+
|
|
65
|
+
Geometry -- same vocabulary as the `Shape` behavior, plus an editable mesh:
|
|
66
|
+
|
|
67
|
+
- `kind`: `"box"` (default) | `"sphere"` | `"cylinder"` | `"capsule"` |
|
|
68
|
+
`"mesh"`.
|
|
69
|
+
- box: `size: [w, h, d]` (default `[1, 1, 1]`).
|
|
70
|
+
- sphere: `radius`. cylinder / capsule: `radius` + `height`.
|
|
71
|
+
- mesh: `vertices: [[x, y, z], ...]` (pivot-relative) + `faces: [[i, j, k,
|
|
72
|
+
...], ...]` -- each face is 3+ vertex indices, CCW seen from outside.
|
|
73
|
+
Quads are the working convention (n-gons fan-triangulate at render, flat
|
|
74
|
+
shaded). This is the flexible core of the format: a box converts to a mesh
|
|
75
|
+
in the editor and from there any form is reachable by moving vertices and
|
|
76
|
+
extruding faces. Mesh parts are `color`-only for now (no art UVs yet).
|
|
77
|
+
|
|
78
|
+
Material -- same fields as `Shape`, per part:
|
|
79
|
+
|
|
80
|
+
- `color`, `art` (a `.pxart`/image path, or on boxes a per-face object
|
|
81
|
+
`{ all, sides, front, back, left, right, top, bottom }`, any ref may pick a
|
|
82
|
+
frame with `path#<n>`), `artRepeat: [u, v]`, `tint`, `roughness`,
|
|
83
|
+
`metalness`, `clearcoat`, `emissive`, `emissiveIntensity`.
|
|
84
|
+
|
|
85
|
+
## Animation hooks
|
|
86
|
+
|
|
87
|
+
The engine animates any model whose part ids follow the walk convention,
|
|
88
|
+
driven by observed motion (anything that moves, walks):
|
|
89
|
+
|
|
90
|
+
- `legL`, `legR` -- swing from their pivots while moving; tuck in the air.
|
|
91
|
+
- `armL`, `armR` -- counter-swing; raise in the air.
|
|
92
|
+
- `torso` -- step bob, and leans into turns. Parent the head/arms to `torso`
|
|
93
|
+
so they ride along.
|
|
94
|
+
|
|
95
|
+
Models without these ids are static (props).
|
|
96
|
+
|
|
97
|
+
## Mesh editing (in the model editor)
|
|
98
|
+
|
|
99
|
+
Select a mesh part and hit **Edit mesh**: pick faces or vertices on the
|
|
100
|
+
stage (shift extends), move the selection with the gizmo, **Extrude** pushes
|
|
101
|
+
selected faces out along their normals. **To mesh** converts a box part into
|
|
102
|
+
an equivalent editable mesh. Planned ops, in the spirit of real polygon
|
|
103
|
+
modelers: inset, bevel, loop cut, edge slide, knife, region (shared-edge)
|
|
104
|
+
extrusion, and mirror-across-axis.
|
|
105
|
+
|
|
106
|
+
## Using a model
|
|
107
|
+
|
|
108
|
+
Give an actor a `Model` behavior: `{ "file": "models/barrel.pxmodel",
|
|
109
|
+
"scale": 1, "yOffset": 0 }`. The model replaces the Shape's mesh; the `Shape`
|
|
110
|
+
still provides the physics collider (and its dimensions should roughly wrap
|
|
111
|
+
the model). Everything else -- Solid, Body, Pickup, etc. -- is unchanged.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "compact",
|
|
3
|
+
"palette": {
|
|
4
|
+
"d": "#8a4836",
|
|
5
|
+
"o": "#bf6f4a",
|
|
6
|
+
"l": "#e69c69"
|
|
7
|
+
},
|
|
8
|
+
"grid": [
|
|
9
|
+
"dddddddddddddddd",
|
|
10
|
+
"dlllllllllllllld",
|
|
11
|
+
"dldoooooooooodld",
|
|
12
|
+
"dlodoooooooodold",
|
|
13
|
+
"dloodoooooodoold",
|
|
14
|
+
"dlooodoooodooold",
|
|
15
|
+
"dloooodoodoooold",
|
|
16
|
+
"dloooooddooooold",
|
|
17
|
+
"dloooooddooooold",
|
|
18
|
+
"dloooodoodoooold",
|
|
19
|
+
"dlooodoooodooold",
|
|
20
|
+
"dloodoooooodoold",
|
|
21
|
+
"dlodoooooooodold",
|
|
22
|
+
"dldoooooooooodld",
|
|
23
|
+
"dlllllllllllllld",
|
|
24
|
+
"dddddddddddddddd"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "compact",
|
|
3
|
+
"palette": {
|
|
4
|
+
"d": "#391f21",
|
|
5
|
+
"o": "#8a4836",
|
|
6
|
+
"l": "#bf6f4a"
|
|
7
|
+
},
|
|
8
|
+
"grid": [
|
|
9
|
+
"dddddddddddddddd",
|
|
10
|
+
"llllllllllllllll",
|
|
11
|
+
"oooooooooooooooo",
|
|
12
|
+
"oooooooooooooooo",
|
|
13
|
+
"dddddddddddddddd",
|
|
14
|
+
"llllllllllllllll",
|
|
15
|
+
"oooooooooooooooo",
|
|
16
|
+
"oooooooooooooooo",
|
|
17
|
+
"dddddddddddddddd",
|
|
18
|
+
"llllllllllllllll",
|
|
19
|
+
"oooooooooooooooo",
|
|
20
|
+
"oooooooooooooooo",
|
|
21
|
+
"dddddddddddddddd",
|
|
22
|
+
"llllllllllllllll",
|
|
23
|
+
"oooooooooooooooo",
|
|
24
|
+
"oooooooooooooooo"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "compact",
|
|
3
|
+
"palette": {
|
|
4
|
+
"d": "#391f21",
|
|
5
|
+
"o": "#8a4836",
|
|
6
|
+
"l": "#bf6f4a",
|
|
7
|
+
"s": "#657392"
|
|
8
|
+
},
|
|
9
|
+
"grid": [
|
|
10
|
+
"dloodloodloodloo",
|
|
11
|
+
"dloodloodloodloo",
|
|
12
|
+
"dloodloodloodloo",
|
|
13
|
+
"dloodloodloodloo",
|
|
14
|
+
"dloodloodloodloo",
|
|
15
|
+
"dloodloodloodloo",
|
|
16
|
+
"dloodloodloodloo",
|
|
17
|
+
"sdsdsdsdsdsdsdsd",
|
|
18
|
+
"sdsdsdsdsdsdsdsd",
|
|
19
|
+
"dloodloodloodloo",
|
|
20
|
+
"dloodloodloodloo",
|
|
21
|
+
"dloodloodloodloo",
|
|
22
|
+
"dloodloodloodloo",
|
|
23
|
+
"dloodloodloodloo",
|
|
24
|
+
"dloodloodloodloo",
|
|
25
|
+
"dloodloodloodloo"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "compact",
|
|
3
|
+
"palette": {
|
|
4
|
+
"f": "#e5ceb4",
|
|
5
|
+
"k": "#391f21",
|
|
6
|
+
"r": "#e69c69"
|
|
7
|
+
},
|
|
8
|
+
"grid": [
|
|
9
|
+
"ffffffffffffffff",
|
|
10
|
+
"ffffffffffffffff",
|
|
11
|
+
"ffffffffffffffff",
|
|
12
|
+
"ffffffffffffffff",
|
|
13
|
+
"ffffffffffffffff",
|
|
14
|
+
"ffffkkffffkkffff",
|
|
15
|
+
"ffffkkffffkkffff",
|
|
16
|
+
"ffffffffffffffff",
|
|
17
|
+
"ffrffffffffffrff",
|
|
18
|
+
"ffffffffffffffff",
|
|
19
|
+
"ffffffkkkkffffff",
|
|
20
|
+
"ffffffffffffffff",
|
|
21
|
+
"ffffffffffffffff",
|
|
22
|
+
"ffffffffffffffff",
|
|
23
|
+
"ffffffffffffffff",
|
|
24
|
+
"ffffffffffffffff"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "compact",
|
|
3
|
+
"palette": {
|
|
4
|
+
"k": "#1b1b23",
|
|
5
|
+
"a": "#24242e",
|
|
6
|
+
"b": "#282833",
|
|
7
|
+
"f": "#2e313f"
|
|
8
|
+
},
|
|
9
|
+
"grid": [
|
|
10
|
+
"kkkkkkkkkkkkkkkk",
|
|
11
|
+
"kaaaaaaakbbbbbbb",
|
|
12
|
+
"kaaaaaaakbbbbbbb",
|
|
13
|
+
"kaaaaaaakbbbbbbb",
|
|
14
|
+
"kaaaaaaakbbbbbbb",
|
|
15
|
+
"kaaaaaaakbbbbbbb",
|
|
16
|
+
"kaaaaaaakbbbbbbb",
|
|
17
|
+
"kaaaaaaakbbbbbbb",
|
|
18
|
+
"kkkkkkkkkkkkkkkk",
|
|
19
|
+
"kbbbbbbbkaaaaaaa",
|
|
20
|
+
"kbbbbbbbkaaaaaaa",
|
|
21
|
+
"kbbbbbbbkaaaaaaa",
|
|
22
|
+
"kbbbbbbbkaaaaaaa",
|
|
23
|
+
"kbbbbbbbkaaaaaaa",
|
|
24
|
+
"kbbbbbbbkaaaaaaa",
|
|
25
|
+
"kbbbbbbbkaaaaaaa"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "compact",
|
|
3
|
+
"palette": {
|
|
4
|
+
"e": "#3a3f52",
|
|
5
|
+
"p": "#657392",
|
|
6
|
+
"d": "#525e78",
|
|
7
|
+
"v": "#c7cfdd"
|
|
8
|
+
},
|
|
9
|
+
"grid": [
|
|
10
|
+
"eeeeeeeeeeeeeeee",
|
|
11
|
+
"eppppppdpppppppe",
|
|
12
|
+
"epvpppdppppppvde",
|
|
13
|
+
"eppppdpppppppdpe",
|
|
14
|
+
"epppdpppppppdppe",
|
|
15
|
+
"eppdpppppppdpppe",
|
|
16
|
+
"epdpppppppdppppe",
|
|
17
|
+
"edpppppppdpppppe",
|
|
18
|
+
"epppppppdppppppe",
|
|
19
|
+
"eppppppdpppppppe",
|
|
20
|
+
"epppppdpppppppde",
|
|
21
|
+
"eppppdpppppppdpe",
|
|
22
|
+
"epppdpppppppdppe",
|
|
23
|
+
"epvdpppppppdpvpe",
|
|
24
|
+
"epdpppppppdppppe",
|
|
25
|
+
"eeeeeeeeeeeeeeee"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "compact",
|
|
3
|
+
"palette": {
|
|
4
|
+
"s": "#b8b5b9",
|
|
5
|
+
"d": "#918e95",
|
|
6
|
+
"l": "#d4d1d5",
|
|
7
|
+
"g": "#567b79"
|
|
8
|
+
},
|
|
9
|
+
"grid": [
|
|
10
|
+
"lslsssssllllllss",
|
|
11
|
+
"sssssssssslssssl",
|
|
12
|
+
"sssssslsssssssss",
|
|
13
|
+
"lssssslsssslslsl",
|
|
14
|
+
"sslssssllssslsss",
|
|
15
|
+
"ssssssssssssssss",
|
|
16
|
+
"lslsslslslssslss",
|
|
17
|
+
"ssssslssslssssss",
|
|
18
|
+
"ssllslssssslssll",
|
|
19
|
+
"ssssssssslssssss",
|
|
20
|
+
"ssssssssssslsssl",
|
|
21
|
+
"slssssssslsslsss",
|
|
22
|
+
"sslsslllslsslsss",
|
|
23
|
+
"ssslsslslsssssss",
|
|
24
|
+
"ssssssssllssssls",
|
|
25
|
+
"llslsssslsssssls"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "compact",
|
|
3
|
+
"palette": {
|
|
4
|
+
"m": "#37363f",
|
|
5
|
+
"a": "#646365",
|
|
6
|
+
"b": "#75717a",
|
|
7
|
+
"c": "#8f8a93"
|
|
8
|
+
},
|
|
9
|
+
"grid": [
|
|
10
|
+
"mmmmmmmmmmmmmmmm",
|
|
11
|
+
"bbbbbmbbbbbbbmbb",
|
|
12
|
+
"bbbbbmbbbbbbbmbb",
|
|
13
|
+
"bbbbbmbbbbbbbmbb",
|
|
14
|
+
"bbbbbmbbbbbbbmbb",
|
|
15
|
+
"mmmmmmmmmmmmmmmm",
|
|
16
|
+
"bmbbbbbbbmbbbbbb",
|
|
17
|
+
"bmbbbbbbbmbbbbbb",
|
|
18
|
+
"bmbbbbbbbmbbbbbb",
|
|
19
|
+
"bmbbbbbbbmbbbbbb",
|
|
20
|
+
"mmmmmmmmmmmmmmmm",
|
|
21
|
+
"bbbbbmbbbbbbbmbb",
|
|
22
|
+
"bbbbbmbbbbbbbmbb",
|
|
23
|
+
"bbbbbmbbbbbbbmbb",
|
|
24
|
+
"bbbbbmbbbbbbbmbb",
|
|
25
|
+
"mmmmmmmmmmmmmmmm"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Play-mode entry point, the 3d counterpart of the imported kit's PlayOnly.
|
|
2
|
+
// Files, assets, live reload, and the behavior registry all come from the
|
|
3
|
+
// physics-2d import (they're renderer-agnostic); only the player is 3d.
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { Lifecycle } from 'castle-web-sdk';
|
|
6
|
+
import { parseJsonFile } from '@imports/castle.physics-2d/engine/files';
|
|
7
|
+
import { useLiveDeckFiles3D } from './modelFiles';
|
|
8
|
+
import { collectAssets } from '@imports/castle.physics-2d/engine/assets';
|
|
9
|
+
import { behaviorClasses } from '@imports/castle.physics-2d/editors/behaviorRegistry';
|
|
10
|
+
import { Scene3DPlayer } from './Scene3DPlayer';
|
|
11
|
+
|
|
12
|
+
const DEFAULT_SCENE = 'scenes/main.scene';
|
|
13
|
+
|
|
14
|
+
export function PlayOnly3D({ initialScene } = {}) {
|
|
15
|
+
const { files, dataVersion } = useLiveDeckFiles3D();
|
|
16
|
+
const scenePath =
|
|
17
|
+
initialScene && files[initialScene] !== undefined ? initialScene : DEFAULT_SCENE;
|
|
18
|
+
const { value: sceneData } = parseJsonFile(scenePath, files[scenePath] ?? '');
|
|
19
|
+
if (!sceneData) return null;
|
|
20
|
+
const { sprites } = collectAssets(files);
|
|
21
|
+
return (
|
|
22
|
+
<Scene3DPlayer
|
|
23
|
+
key={`${scenePath}:${dataVersion}`}
|
|
24
|
+
sceneData={sceneData}
|
|
25
|
+
sprites={sprites}
|
|
26
|
+
files={files}
|
|
27
|
+
behaviorClasses={behaviorClasses}
|
|
28
|
+
scenePath={scenePath}
|
|
29
|
+
onFirstFrame={Lifecycle.ready}
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
32
|
+
}
|