castle-web-cli 0.4.129 → 0.4.131

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.
Files changed (144) hide show
  1. package/dist/agent-prompts.js +4 -4
  2. package/dist/filesChanged.d.ts +2 -0
  3. package/dist/filesChanged.js +6 -2
  4. package/dist/ide.js +15 -4
  5. package/dist/importBrowse.js +1 -0
  6. package/dist/index.js +10 -4
  7. package/dist/init.js +63 -15
  8. package/dist/native/loop.js +1 -1
  9. package/dist/native/tools.js +1 -1
  10. package/dist/serve.d.ts +1 -0
  11. package/dist/serve.js +20 -1
  12. package/dist/shell/assets/index-BpOLUyVO.js +441 -0
  13. package/dist/shell/assets/{index-CAq6f9B5.css → index-D6K-0YDB.css} +1 -1
  14. package/dist/shell/index.html +2 -2
  15. package/kits/physics-2d/CLAUDE.md +9 -10
  16. package/kits/physics-2d/castle.json +1 -1
  17. package/kits/physics-2d/editors/PlayOnly.jsx +16 -6
  18. package/kits/physics-2d/editors/PxArtEditor.jsx +95 -31
  19. package/kits/physics-2d/editors/SceneEditor.jsx +10 -10
  20. package/kits/physics-2d/editors/SingleEditor.jsx +37 -8
  21. package/kits/physics-2d/editors/StyleEditor.jsx +7 -4
  22. package/kits/physics-2d/editors/pixelEditorChrome.jsx +7 -7
  23. package/kits/physics-2d/editors/pixelInspector.jsx +13 -7
  24. package/kits/physics-2d/editors/pxArtTimeline.jsx +29 -11
  25. package/kits/physics-2d/editors/pxArtTimeline.module.css +11 -0
  26. package/kits/physics-2d/engine/ScenePlayer.jsx +2 -2
  27. package/kits/physics-2d/engine/blueprint.js +23 -5
  28. package/kits/physics-2d/engine/liveReload.js +33 -21
  29. package/kits/physics-2d/engine/scene.js +17 -5
  30. package/kits/physics-2d/engine/systemRegistry.js +1 -1
  31. package/kits/physics-2d/engine/ui.jsx +2 -2
  32. package/kits/physics-2d/engine/ui.module.css +42 -0
  33. package/kits/physics-3d/CLAUDE.md +108 -0
  34. package/kits/physics-3d/behaviors/Body.jsx +51 -0
  35. package/kits/physics-3d/behaviors/Door.jsx +31 -0
  36. package/kits/physics-3d/behaviors/Lookable.jsx +11 -0
  37. package/kits/physics-3d/behaviors/Model.jsx +14 -0
  38. package/kits/physics-3d/behaviors/Pickup.jsx +39 -0
  39. package/kits/physics-3d/behaviors/Player.jsx +172 -0
  40. package/kits/physics-3d/behaviors/Shape.jsx +75 -0
  41. package/kits/physics-3d/behaviors/Solid.jsx +11 -0
  42. package/kits/physics-3d/behaviors/Transform.jsx +24 -0
  43. package/kits/physics-3d/blueprints/barrel.scene +15 -0
  44. package/kits/physics-3d/blueprints/crate.scene +29 -0
  45. package/kits/physics-3d/blueprints/door.scene +35 -0
  46. package/kits/physics-3d/blueprints/gem.scene +26 -0
  47. package/kits/physics-3d/blueprints/pillar.scene +25 -0
  48. package/kits/physics-3d/blueprints/platform.scene +23 -0
  49. package/kits/physics-3d/blueprints/player.scene +29 -0
  50. package/kits/physics-3d/blueprints/rock.scene +14 -0
  51. package/kits/physics-3d/blueprints/statue.scene +26 -0
  52. package/kits/physics-3d/blueprints/tree.scene +14 -0
  53. package/kits/physics-3d/blueprints/wall.scene +26 -0
  54. package/kits/{basic-2d → physics-3d}/castle.json +23 -5
  55. package/kits/physics-3d/docs/pxmodel-format.md +111 -0
  56. package/kits/physics-3d/drawings/crate.pxart +26 -0
  57. package/kits/physics-3d/drawings/door-edge.pxart +26 -0
  58. package/kits/physics-3d/drawings/door.pxart +27 -0
  59. package/kits/physics-3d/drawings/face.pxart +26 -0
  60. package/kits/physics-3d/drawings/floor.pxart +27 -0
  61. package/kits/physics-3d/drawings/platform.pxart +27 -0
  62. package/kits/physics-3d/drawings/statue.pxart +27 -0
  63. package/kits/physics-3d/drawings/wall.pxart +27 -0
  64. package/kits/physics-3d/engine3d/PlayOnly3D.jsx +36 -0
  65. package/kits/physics-3d/engine3d/PxModelEditor.jsx +619 -0
  66. package/kits/physics-3d/engine3d/Scene3DEditor.jsx +618 -0
  67. package/kits/physics-3d/engine3d/Scene3DPlayer.jsx +309 -0
  68. package/kits/physics-3d/engine3d/editor3dData.js +114 -0
  69. package/kits/physics-3d/engine3d/editor3dInspector.jsx +404 -0
  70. package/kits/physics-3d/engine3d/editorChrome.jsx +218 -0
  71. package/kits/physics-3d/engine3d/editorWorld.js +249 -0
  72. package/kits/physics-3d/engine3d/materials.js +174 -0
  73. package/kits/physics-3d/engine3d/meshops.js +123 -0
  74. package/kits/physics-3d/engine3d/modelEditorWorld.js +439 -0
  75. package/kits/physics-3d/engine3d/modelFiles.js +136 -0
  76. package/kits/physics-3d/engine3d/pxmodel.js +265 -0
  77. package/kits/physics-3d/engine3d/thumbnails.js +137 -0
  78. package/kits/physics-3d/engine3d/world3d.js +216 -0
  79. package/kits/{basic-2d → physics-3d}/eslint.config.js +10 -25
  80. package/kits/physics-3d/index.html +20 -0
  81. package/kits/physics-3d/main.jsx +30 -0
  82. package/kits/physics-3d/models/barrel.pxmodel +10 -0
  83. package/kits/physics-3d/models/player.pxmodel +222 -0
  84. package/kits/physics-3d/models/rock.pxmodel +30 -0
  85. package/kits/physics-3d/models/tree.pxmodel +10 -0
  86. package/kits/{basic-2d → physics-3d}/package-lock.json +140 -119
  87. package/kits/{basic-2d → physics-3d}/package.json +11 -9
  88. package/kits/{basic-2d → physics-3d}/pnpm-lock.yaml +162 -137
  89. package/kits/physics-3d/scenes/main.scene +398 -0
  90. package/kits/physics-3d/scenes/model-lab.scene +111 -0
  91. package/kits/physics-3d/systems/physics3d.js +356 -0
  92. package/package.json +5 -2
  93. package/dist/shell/assets/index-DKu9ejyh.js +0 -436
  94. package/kits/basic-2d/CLAUDE.md +0 -221
  95. package/kits/basic-2d/behaviors/Camera.jsx +0 -43
  96. package/kits/basic-2d/behaviors/Collider.jsx +0 -213
  97. package/kits/basic-2d/behaviors/Layout.jsx +0 -53
  98. package/kits/basic-2d/behaviors/Sprite.jsx +0 -357
  99. package/kits/basic-2d/behaviors/tint.js +0 -47
  100. package/kits/basic-2d/blueprints/cauldron.scene +0 -20
  101. package/kits/basic-2d/docs/pxart-format.md +0 -377
  102. package/kits/basic-2d/drawings/cauldron.pxart +0 -113
  103. package/kits/basic-2d/editors/BlueprintLibrary.jsx +0 -270
  104. package/kits/basic-2d/editors/ErrorBoundary.jsx +0 -59
  105. package/kits/basic-2d/editors/PlayOnly.jsx +0 -31
  106. package/kits/basic-2d/editors/PxArtEditor.jsx +0 -1092
  107. package/kits/basic-2d/editors/SceneEditor.jsx +0 -1780
  108. package/kits/basic-2d/editors/SelectionOverlay.jsx +0 -909
  109. package/kits/basic-2d/editors/SingleEditor.jsx +0 -122
  110. package/kits/basic-2d/editors/behaviorRegistry.js +0 -34
  111. package/kits/basic-2d/editors/editorHistory.js +0 -157
  112. package/kits/basic-2d/editors/inspectorSheet.js +0 -13
  113. package/kits/basic-2d/editors/pixelCanvas.js +0 -11
  114. package/kits/basic-2d/editors/pixelEditorChrome.jsx +0 -74
  115. package/kits/basic-2d/editors/pixelGeometry.js +0 -140
  116. package/kits/basic-2d/editors/pixelInspector.jsx +0 -633
  117. package/kits/basic-2d/editors/pxArtEditorModel.js +0 -732
  118. package/kits/basic-2d/editors/pxArtPlayback.js +0 -92
  119. package/kits/basic-2d/editors/pxArtTimeline.jsx +0 -752
  120. package/kits/basic-2d/editors/pxArtTimeline.module.css +0 -506
  121. package/kits/basic-2d/editors/pxArtTools.js +0 -232
  122. package/kits/basic-2d/editors/useArtboardFit.js +0 -105
  123. package/kits/basic-2d/engine/ScenePlayer.jsx +0 -209
  124. package/kits/basic-2d/engine/SceneUI.jsx +0 -59
  125. package/kits/basic-2d/engine/assets.js +0 -15
  126. package/kits/basic-2d/engine/autoInspector.jsx +0 -70
  127. package/kits/basic-2d/engine/behaviorExtensions.js +0 -32
  128. package/kits/basic-2d/engine/blueprint.js +0 -557
  129. package/kits/basic-2d/engine/collider.js +0 -200
  130. package/kits/basic-2d/engine/files.js +0 -141
  131. package/kits/basic-2d/engine/liveReload.js +0 -88
  132. package/kits/basic-2d/engine/pxart.js +0 -1032
  133. package/kits/basic-2d/engine/pxartSmooth.js +0 -222
  134. package/kits/basic-2d/engine/scene.js +0 -696
  135. package/kits/basic-2d/engine/spriteGeometry.js +0 -32
  136. package/kits/basic-2d/engine/systemRegistry.js +0 -16
  137. package/kits/basic-2d/engine/ui.jsx +0 -695
  138. package/kits/basic-2d/engine/ui.module.css +0 -2287
  139. package/kits/basic-2d/index.html +0 -24
  140. package/kits/basic-2d/main.jsx +0 -24
  141. package/kits/basic-2d/scenes/main.scene +0 -16
  142. package/kits/basic-2d/scripts/draw.mjs +0 -121
  143. /package/kits/{basic-2d → physics-3d}/.prettierrc +0 -0
  144. /package/kits/{basic-2d → physics-3d}/vite.config.js +0 -0
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "Pillar",
3
+ "actors": [
4
+ {
5
+ "components": {
6
+ "Transform": {
7
+ "y": 1.5
8
+ },
9
+ "Shape": {
10
+ "kind": "cylinder",
11
+ "radius": 0.3,
12
+ "height": 3,
13
+ "art": "drawings/wall.pxart",
14
+ "artRepeat": [
15
+ 1,
16
+ 1.5
17
+ ],
18
+ "color": "#868188",
19
+ "roughness": 0.85
20
+ },
21
+ "Solid": {}
22
+ }
23
+ }
24
+ ]
25
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "Platform",
3
+ "actors": [
4
+ {
5
+ "components": {
6
+ "Transform": {
7
+ "y": 0.2
8
+ },
9
+ "Shape": {
10
+ "kind": "box",
11
+ "width": 2,
12
+ "height": 0.4,
13
+ "depth": 2,
14
+ "art": "drawings/platform.pxart",
15
+ "color": "#657392",
16
+ "roughness": 0.8,
17
+ "metalness": 0.35
18
+ },
19
+ "Solid": {}
20
+ }
21
+ }
22
+ ]
23
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "Player",
3
+ "actors": [
4
+ {
5
+ "components": {
6
+ "Transform": {
7
+ "y": 1
8
+ },
9
+ "Shape": {
10
+ "kind": "capsule",
11
+ "radius": 0.35,
12
+ "height": 1.4,
13
+ "color": "#cf8acb",
14
+ "roughness": 0.4,
15
+ "clearcoat": 0.5
16
+ },
17
+ "Body": {
18
+ "type": "dynamic",
19
+ "lockRotations": true,
20
+ "friction": 0,
21
+ "gravityScale": 2
22
+ },
23
+ "Solid": {},
24
+ "Model": { "file": "models/player.pxmodel", "yOffset": -0.7 },
25
+ "Player": {}
26
+ }
27
+ }
28
+ ]
29
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "Rock",
3
+ "actors": [
4
+ {
5
+ "components": {
6
+ "Transform": { "y": 0.4 },
7
+ "Shape": { "kind": "box", "width": 1, "height": 0.8, "depth": 1 },
8
+ "Model": { "file": "models/rock.pxmodel", "yOffset": -0.4 },
9
+ "Solid": {},
10
+ "Lookable": { "text": "a rock.", "range": 3 }
11
+ }
12
+ }
13
+ ]
14
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "Statue",
3
+ "actors": [
4
+ {
5
+ "components": {
6
+ "Transform": {
7
+ "y": 0.8
8
+ },
9
+ "Shape": {
10
+ "kind": "cylinder",
11
+ "radius": 0.5,
12
+ "height": 1.6,
13
+ "art": "drawings/statue.pxart",
14
+ "color": "#b8b5b9",
15
+ "roughness": 0.55,
16
+ "metalness": 0.1
17
+ },
18
+ "Solid": {},
19
+ "Lookable": {
20
+ "text": "an old stone statue.",
21
+ "range": 4
22
+ }
23
+ }
24
+ }
25
+ ]
26
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "Tree",
3
+ "actors": [
4
+ {
5
+ "components": {
6
+ "Transform": { "y": 0.9 },
7
+ "Shape": { "kind": "cylinder", "radius": 0.22, "height": 1.8 },
8
+ "Model": { "file": "models/tree.pxmodel", "yOffset": -0.9 },
9
+ "Solid": {},
10
+ "Lookable": { "text": "a tree.", "range": 3.5 }
11
+ }
12
+ }
13
+ ]
14
+ }
@@ -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
- "deckId": "5R39TxaRfLLQ",
54
- "cardId": "AZk0PWHTrFcT",
55
- "title": "basic-2d",
56
- "publishedVersion": "2026-08-06T19:58:54.294Z"
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:23:26.516Z"
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,36 @@
1
+ // Play-mode entry point, the 3d counterpart of the imported kit's PlayOnly.
2
+ // Files, assets and the behavior registry all come from the physics-2d import
3
+ // (they're renderer-agnostic); only the player is 3d.
4
+ //
5
+ // Nothing is folded into a run in progress: a file changing on disk can always
6
+ // have altered how the run would have gone up to this point. Getting current is
7
+ // a whole-panel reload, and the shell decides when.
8
+ import React from 'react';
9
+ import { Lifecycle } from 'castle-web-sdk';
10
+ import { parseJsonFile } from '@imports/castle.physics-2d/engine/files';
11
+ import { initialFiles3D } from './modelFiles';
12
+ import { collectAssets } from '@imports/castle.physics-2d/engine/assets';
13
+ import { behaviorClasses } from '@imports/castle.physics-2d/editors/behaviorRegistry';
14
+ import { Scene3DPlayer } from './Scene3DPlayer';
15
+
16
+ const DEFAULT_SCENE = 'scenes/main.scene';
17
+
18
+ export function PlayOnly3D({ initialScene } = {}) {
19
+ const files = initialFiles3D;
20
+ const scenePath =
21
+ initialScene && files[initialScene] !== undefined ? initialScene : DEFAULT_SCENE;
22
+ const { value: sceneData } = parseJsonFile(scenePath, files[scenePath] ?? '');
23
+ if (!sceneData) return null;
24
+ const { sprites } = collectAssets(files);
25
+ return (
26
+ <Scene3DPlayer
27
+ key={scenePath}
28
+ sceneData={sceneData}
29
+ sprites={sprites}
30
+ files={files}
31
+ behaviorClasses={behaviorClasses}
32
+ scenePath={scenePath}
33
+ onFirstFrame={Lifecycle.ready}
34
+ />
35
+ );
36
+ }