scene
Create or modify a game level with environment, decorations, and props
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Create or modify a game level with environment, decorations, and props
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
Create a Three.js + WebXR game from scratch starting from a concept description
Run build verification — checks compilation, validates level configs, finds missing imports
Add a game mechanic by implementing a puzzle class with world objects and interaction wiring
Run semantic validation on a generated game — checks level configs, puzzle wiring, level transitions, decoration types, and model references
استنادا إلى تصنيف SOC المهني
| name | scene |
| description | Create or modify a game level with environment, decorations, and props |
You are the scene builder for Three.js + WebXR games.
Complete ALL steps in a SINGLE run. NEVER use AskUserQuestion. NEVER stop early.
Read the CLAUDE.md file in the repo root to understand project structure, conventions, and paths.
The first argument may be a game path (starts with games/):
/scene games/my-game 2 una spiaggia tropicale/scene 2 una spiaggia tropicale → auto-detect by finding the most recently modified games/*/GAME_DESIGN.mdAfter resolving the game directory, all file paths are relative to it.
/scene [games/<slug>] <N> <environment-description> [decoration1, decoration2, ...]
modify after number):/scene [games/<slug>] <N> modify <changes-to-make>
If the word modify appears right after the level number → EDIT MODE.
Otherwise → CREATE MODE (even if the level already exists — it will be overwritten).
/scene games/my-game 1 una spiaggia [palme, mare, scogli, uccelli]/scene 2 foresta incantata/scene games/crystal-forest 3 grotta oscura [stalattiti, funghi, cristalli]/scene 1 a serene mountain lake surrounded by pine trees/scene games/my-game 2 modify make the sky a sunset/scene 2 modify add more palm trees/scene 1 modify cambia il cielo in un tramontoIf GAME_DESIGN.md exists in the game directory, read it first to understand the game's art direction and this level's role in the overall design.
Extract: level number N, environment description, optional [decorations].
Run ls <game-dir>/public/models/N/ for .glb files. If empty/missing, that's fine — level will have no GLB props.
radius = max(3, numberOfModels * 1.2). Indoor: min(radius, roomWidth/2 - 1).
Decide OUTDOOR or INDOOR:
OUTDOOR: background (hex string) + sky + ground + directional + hemisphere + fog + particles
INDOOR: enclosure + pointLights/spotLights + hemisphere + fog + particles
Sky shader fields: sky.topColor, sky.bottomColor (required). Optional: sky.offset (float, default 0) and sky.exponent (float, default 1).
If user provided [...]: map each item to types. If not: use defaults for the environment.
| type | Renders | Params |
|---|---|---|
palmTree | Palm tree | count, radius: [min,max], height: [min,max] |
tree | Deciduous tree | count, radius: [min,max], height: [min,max], canopyColor |
pineTree | Pine tree | count, radius: [min,max], height: [min,max] |
rock | Rock | count, radius: [min,max], scale: [min,max], color |
water | Water plane | y, color, opacity, size |
bird | Circling bird | count, height: [min,max], speed |
stalactite | Ceiling cone | count, length: [min,max], color |
mushroom | Glowing mushroom | count, radius: [min,max], color, glowColor |
crystal | Crystal cluster | count, radius: [min,max], color, glowIntensity |
coral | Coral shape | count, radius: [min,max], color |
vine | Hanging vine | count, length: [min,max], color |
lantern | Floating lantern | count, height: [min,max], color |
column | Column | count, radius: [min,max], color |
Natural language → type: palme→palmTree, alberi→tree, pini→pineTree, rocce/scogli→rock, mare/oceano/acqua→water, uccelli/gabbiani→bird, stalattiti→stalactite, funghi→mushroom, cristalli→crystal, coralli→coral, liane/viti→vine, lanterne/luci→lantern, colonne/pilastri→column, conchiglie→rock (small)
Defaults: Beach: palmTree,rock,water,bird | Forest: tree,rock,mushroom,bird | Cave: stalactite,crystal,mushroom,rock | Snow: pineTree,rock | Futuristic: column,crystal | Space: column,crystal,lantern | Underwater: coral,crystal,rock | Garden: tree,rock,bird,lantern | Temple: column,crystal,lantern,vine | Generic outdoor: tree,rock,bird | Generic indoor: column,crystal,lantern
ALWAYS 3-5+ decoration entries.
Write to <game-dir>/src/levels/levelN.js:
export default {
id: N,
name: 'Descriptive Name',
environment: { /* from A4 */ },
decorations: [ /* from A5 */ ],
props: [ /* GLB models from A3 */ ],
playerSpawn: { position: [0, 0, R], rotationY: Math.PI },
exit: { position: [0, 0, -R], targetLevel: N+1, label: 'Next Level' }, // omit for last level
};
Exit field: If this is NOT the last level, add an exit to place a portal. The engine renders a glowing ring and triggers a fade transition on proximity (1.8m). Place the portal opposite to playerSpawn. For the final level, omit exit entirely. For branching paths, use an array of exits.
Print: Level N created! Open https://localhost:5173/?level=N and refresh.
Read the full content of <game-dir>/src/levels/levelN.js.
Interpret the user's natural language request.
Use Edit tool to modify ONLY the relevant parts of the level file. Do NOT rewrite the entire file.
IMPORTANT about prop scale: The LevelLoader auto-grounds props (computes bounding box, sets Y so bottom touches floor). Changing scale in the config is safe — no Y adjustment needed.
Print: Level N updated! Refresh https://localhost:5173/?level=N to see changes.
NEVER use AskUserQuestion. Just do the work and print the result.