dylanebert commited on
Commit
2301979
·
1 Parent(s): dd99b77

simplify template

Browse files
Files changed (5) hide show
  1. .claude/commands/nourish.md +1 -0
  2. bun.lock +4 -2
  3. llms.txt +37 -5
  4. package.json +1 -1
  5. src/lib/stores/editor.ts +0 -32
.claude/commands/nourish.md CHANGED
@@ -6,6 +6,7 @@ Complete conversation by updating context and applying cleanup.
6
 
7
  @CLAUDE.md
8
  @layers/structure.md
 
9
  @llms.txt
10
 
11
  User arguments: "$ARGUMENTS"
 
6
 
7
  @CLAUDE.md
8
  @layers/structure.md
9
+ @layers/context-template.md
10
  @llms.txt
11
 
12
  User arguments: "$ARGUMENTS"
bun.lock CHANGED
@@ -14,7 +14,7 @@
14
  "marked": "^16.2.1",
15
  "monaco-editor": "^0.50.0",
16
  "svelte-splitpanes": "^8.0.5",
17
- "vibegame": "^0.1.4",
18
  "zod": "^4.1.8",
19
  },
20
  "devDependencies": {
@@ -652,6 +652,8 @@
652
 
653
  "postcss": ["postcss@8.5.6", "", { "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg=="],
654
 
 
 
655
  "prelude-ls": ["prelude-ls@1.2.1", "", {}, "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g=="],
656
 
657
  "prettier": ["prettier@3.6.2", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ=="],
@@ -780,7 +782,7 @@
780
 
781
  "uuid": ["uuid@10.0.0", "", { "bin": { "uuid": "dist/bin/uuid" } }, "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ=="],
782
 
783
- "vibegame": ["vibegame@0.1.4", "", { "dependencies": { "@dimforge/rapier3d-compat": "^0.18.2", "gsap": "^3.13.0", "zod": "^4.1.5" }, "peerDependencies": { "bitecs": ">=0.3.40", "three": ">=0.170.0" } }, "sha512-U8iZzedz/egganPKym2Kjc7ZG1YJpnZ2CuB1q+e+1H3tOPrH5rBrwUKK+5jfBtgdUkMVT451GIcXioF+YBsKHg=="],
784
 
785
  "vite": ["vite@5.4.20", "", { "dependencies": { "esbuild": "^0.21.3", "postcss": "^8.4.43", "rollup": "^4.20.0" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^18.0.0 || >=20.0.0", "less": "*", "lightningcss": "^1.21.0", "sass": "*", "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.4.0" }, "optionalPeers": ["@types/node", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser"], "bin": { "vite": "bin/vite.js" } }, "sha512-j3lYzGC3P+B5Yfy/pfKNgVEg4+UtcIJcVRt2cDjIOmhLourAqPqf8P7acgxeiSgUB7E3p2P8/3gNIgDLpwzs4g=="],
786
 
 
14
  "marked": "^16.2.1",
15
  "monaco-editor": "^0.50.0",
16
  "svelte-splitpanes": "^8.0.5",
17
+ "vibegame": "^0.1.6",
18
  "zod": "^4.1.8",
19
  },
20
  "devDependencies": {
 
652
 
653
  "postcss": ["postcss@8.5.6", "", { "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg=="],
654
 
655
+ "postprocessing": ["postprocessing@6.37.8", "", { "peerDependencies": { "three": ">= 0.157.0 < 0.181.0" } }, "sha512-qTFUKS51z/fuw2U+irz4/TiKJ/0oI70cNtvQG1WxlPKvBdJUfS1CcFswJd5ATY3slotWfvkDDZAsj1X0fU8BOQ=="],
656
+
657
  "prelude-ls": ["prelude-ls@1.2.1", "", {}, "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g=="],
658
 
659
  "prettier": ["prettier@3.6.2", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ=="],
 
782
 
783
  "uuid": ["uuid@10.0.0", "", { "bin": { "uuid": "dist/bin/uuid" } }, "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ=="],
784
 
785
+ "vibegame": ["vibegame@0.1.6", "", { "dependencies": { "@dimforge/rapier3d-compat": "^0.18.2", "gsap": "^3.13.0", "postprocessing": "^6.37.8", "zod": "^4.1.5" }, "peerDependencies": { "bitecs": ">=0.3.40", "three": ">=0.170.0" } }, "sha512-xls8UcndcU2jU4YlCOUR3iDQCQozHtvpuspwHrOJQiRmdozFh534WcqA03RIh0MlWpyCqNy2CWH0OtKEyAyVYg=="],
786
 
787
  "vite": ["vite@5.4.20", "", { "dependencies": { "esbuild": "^0.21.3", "postcss": "^8.4.43", "rollup": "^4.20.0" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^18.0.0 || >=20.0.0", "less": "*", "lightningcss": "^1.21.0", "sass": "*", "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.4.0" }, "optionalPeers": ["@types/node", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser"], "bin": { "vite": "bin/vite.js" } }, "sha512-j3lYzGC3P+B5Yfy/pfKNgVEg4+UtcIJcVRt2cDjIOmhLourAqPqf8P7acgxeiSgUB7E3p2P8/3gNIgDLpwzs4g=="],
788
 
llms.txt CHANGED
@@ -106,7 +106,7 @@ const DamageSystem: GAME.System = {
106
  update: (state) => {
107
  const entities = healthQuery(state.world);
108
  for (const entity of entities) {
109
- Health.current[entity] -= 1 * state.time.delta;
110
  if (Health.current[entity] <= 0) {
111
  state.destroyEntity(entity);
112
  }
@@ -148,6 +148,22 @@ While auto-creation is recommended, you can manually create these for customizat
148
 
149
  **Best Practice**: Use auto-creation unless you specifically need custom positions, properties, or multiple instances. The defaults are well-tuned for most games.
150
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  ## Common Game Patterns
152
 
153
  ### Basic Platformer
@@ -341,6 +357,7 @@ Recipes are registered component bundles with defaults:
341
  - **Third-person character control** - WASD + mouse camera
342
  - **Gamepad support** - Xbox/PlayStation controllers
343
  - **Visual effects** - Tweening colors, positions, rotations
 
344
 
345
  ### Example Prompts That Work
346
  - "Create a platformer with moving platforms and collectible coins"
@@ -440,7 +457,7 @@ const HealthSystem: GAME.System = {
440
  for (const entity of entities) {
441
  // Regenerate health over time
442
  if (Health.current[entity] < Health.max[entity]) {
443
- Health.current[entity] += 5 * state.time.delta;
444
  }
445
  }
446
  }
@@ -546,7 +563,7 @@ Complete player character controller with physics movement and jumping.
546
  Foundation for declarative XML entity creation with parent-child hierarchies and attribute shorthands.
547
 
548
  ### Rendering
549
- Three.js rendering pipeline with meshes, lights, and cameras.
550
 
551
  ### Respawn
552
  Automatic respawn system that resets entities when falling below Y=-100.
@@ -939,6 +956,21 @@ Tag component (no properties)
939
  - directionZ: f32 (-1)
940
  - distance: f32 (30)
941
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
942
  ### Systems
943
 
944
  #### MeshInstanceSystem
@@ -951,11 +983,11 @@ Tag component (no properties)
951
 
952
  #### CameraSyncSystem
953
  - Group: draw
954
- - Updates Three.js camera
955
 
956
  #### WebGLRenderSystem
957
  - Group: draw (last)
958
- - Renders scene to canvas
959
 
960
  ### Functions
961
 
 
106
  update: (state) => {
107
  const entities = healthQuery(state.world);
108
  for (const entity of entities) {
109
+ Health.current[entity] -= 1 * state.time.deltaTime;
110
  if (Health.current[entity] <= 0) {
111
  state.destroyEntity(entity);
112
  }
 
148
 
149
  **Best Practice**: Use auto-creation unless you specifically need custom positions, properties, or multiple instances. The defaults are well-tuned for most games.
150
 
151
+ ## Post-Processing Effects
152
+
153
+ ```xml
154
+ <!-- Bloom effect for glow -->
155
+ <camera bloom="intensity: 2; luminance-threshold: 0.8"></camera>
156
+
157
+ <!-- Retro dithering (reduces color palette) -->
158
+ <camera dithering="color-bits: 3; scale: 2; noise: 1"></camera>
159
+
160
+ <!-- Tonemapping for HDR-like visuals -->
161
+ <camera tonemapping="mode: aces-filmic"></camera>
162
+
163
+ <!-- Combined cinematic style -->
164
+ <camera bloom="intensity: 1.5" tonemapping="mode: aces-filmic"></camera>
165
+ ```
166
+
167
  ## Common Game Patterns
168
 
169
  ### Basic Platformer
 
357
  - **Third-person character control** - WASD + mouse camera
358
  - **Gamepad support** - Xbox/PlayStation controllers
359
  - **Visual effects** - Tweening colors, positions, rotations
360
+ - **Post-processing** - Bloom, dithering, and tonemapping effects for visual styling
361
 
362
  ### Example Prompts That Work
363
  - "Create a platformer with moving platforms and collectible coins"
 
457
  for (const entity of entities) {
458
  // Regenerate health over time
459
  if (Health.current[entity] < Health.max[entity]) {
460
+ Health.current[entity] += 5 * state.time.deltaTime;
461
  }
462
  }
463
  }
 
563
  Foundation for declarative XML entity creation with parent-child hierarchies and attribute shorthands.
564
 
565
  ### Rendering
566
+ Three.js rendering pipeline with meshes, lights, cameras, and post-processing effects.
567
 
568
  ### Respawn
569
  Automatic respawn system that resets entities when falling below Y=-100.
 
956
  - directionZ: f32 (-1)
957
  - distance: f32 (30)
958
 
959
+ #### Bloom
960
+ - intensity: f32 (1.0) - Bloom intensity
961
+ - luminanceThreshold: f32 (1.0) - Luminance threshold for bloom
962
+ - luminanceSmoothing: f32 (0.03) - Smoothness of luminance threshold
963
+ - mipmapBlur: ui8 (1) - Enable mipmap blur
964
+ - radius: f32 (0.85) - Blur radius for mipmap blur
965
+ - levels: ui8 (8) - Number of MIP levels for mipmap blur
966
+
967
+ #### Dithering
968
+ - colorBits: ui8 (4) - Bits per color channel (1-8)
969
+ - intensity: f32 (1.0) - Effect intensity (0-1)
970
+ - grayscale: ui8 (0) - Enable grayscale mode (0/1)
971
+ - scale: f32 (1.0) - Pattern scale (higher = coarser dithering)
972
+ - noise: f32 (1.0) - Noise threshold intensity
973
+
974
  ### Systems
975
 
976
  #### MeshInstanceSystem
 
983
 
984
  #### CameraSyncSystem
985
  - Group: draw
986
+ - Updates Three.js camera and manages post-processing effects
987
 
988
  #### WebGLRenderSystem
989
  - Group: draw (last)
990
+ - Renders scene through EffectComposer
991
 
992
  ### Functions
993
 
package.json CHANGED
@@ -46,7 +46,7 @@
46
  "marked": "^16.2.1",
47
  "monaco-editor": "^0.50.0",
48
  "svelte-splitpanes": "^8.0.5",
49
- "vibegame": "^0.1.4",
50
  "zod": "^4.1.8"
51
  }
52
  }
 
46
  "marked": "^16.2.1",
47
  "monaco-editor": "^0.50.0",
48
  "svelte-splitpanes": "^8.0.5",
49
+ "vibegame": "^0.1.6",
50
  "zod": "^4.1.8"
51
  }
52
  }
src/lib/stores/editor.ts CHANGED
@@ -9,47 +9,15 @@ export interface EditorState {
9
  const DEFAULT_CONTENT = `<canvas id="game-canvas"></canvas>
10
 
11
  <world canvas="#game-canvas" sky="#87ceeb">
12
- <player pos="0 0 0"></player>
13
-
14
  <!-- Ground -->
15
  <static-part pos="0 -0.5 0" shape="box" size="20 1 20" color="#90ee90"></static-part>
16
 
17
  <!-- Ball -->
18
  <dynamic-part pos="-2 4 -3" shape="sphere" size="1" color="#ff4500"></dynamic-part>
19
-
20
- <!-- Custom component -->
21
- <entity my-component="value: 0"></entity>
22
  </world>
23
 
24
  <script>
25
- // GAME is automatically provided by the framework
26
  console.log("Game script loaded!");
27
-
28
- const MyComponent = GAME.defineComponent({
29
- value: GAME.Types.i32,
30
- });
31
-
32
- const myQuery = GAME.defineQuery([MyComponent]);
33
-
34
- const MySystem = {
35
- update: (state) => {
36
- const entities = myQuery(state.world);
37
- for (const entity of entities) {
38
- MyComponent.value[entity]++;
39
- if (MyComponent.value[entity] === 100) {
40
- console.log("Entity value is 100");
41
- }
42
- }
43
- }
44
- };
45
-
46
- const MyPlugin = {
47
- components: { MyComponent },
48
- systems: [MySystem],
49
- };
50
-
51
- GAME.withPlugin(MyPlugin);
52
- // .run() is handled by the framework
53
  </script>`;
54
 
55
  function createEditorStore() {
 
9
  const DEFAULT_CONTENT = `<canvas id="game-canvas"></canvas>
10
 
11
  <world canvas="#game-canvas" sky="#87ceeb">
 
 
12
  <!-- Ground -->
13
  <static-part pos="0 -0.5 0" shape="box" size="20 1 20" color="#90ee90"></static-part>
14
 
15
  <!-- Ball -->
16
  <dynamic-part pos="-2 4 -3" shape="sphere" size="1" color="#ff4500"></dynamic-part>
 
 
 
17
  </world>
18
 
19
  <script>
 
20
  console.log("Game script loaded!");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  </script>`;
22
 
23
  function createEditorStore() {