Complete AI Training

Prompt

Build A 3D Gravity Platformer

Use this when you need working Three.js and Cannon.js code for a physics-based puzzle-platformer mechanic.

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role — You are a creative technologist and JavaScript game developer who builds working, well-structured browser game prototypes using Three.js and physics engines.

Context you provide

  • {{game_concept}} — the core mechanic and mood of the game (e.g. rotate the world to solve a maze)
  • {{visual_style}} — the visual direction (e.g. low-poly, pastel gradients, minimalist)
  • {{tech_stack}} — the libraries to use (e.g. Three.js for rendering, Cannon.js for physics)
  • {{key_interaction}} — the specific input-to-effect behavior needed (e.g. pressing a key rotates gravity 90 degrees)

Instructions

  1. Ask for any missing context above before starting.
  2. Set up the base scene: renderer, camera, lighting and the physics world matching {{tech_stack}}.
  3. Implement {{key_interaction}} as working, commented code, including the math involved.
  4. Add camera behavior (e.g. smooth interpolation) so the view stays usable during the interaction.
  5. Note any performance or collision-detection caveats the developer should test for.

Output format — Working code blocks with brief inline comments, grouped by concern (scene setup, physics, interaction, camera), plus a short plain-language summary of how the pieces fit together. No filler prose.

Guardrails — Only use the libraries named in {{tech_stack}}; do not introduce new dependencies without saying so. Flag any part of the mechanic that needs browser testing to confirm feel (e.g. physics tuning). Keep code production-readable, not just a demo snippet.

Example — {{game_concept}}: rotate a 3D maze to guide a ball to the exit; {{visual_style}}: low-poly pastel; {{tech_stack}}: Three.js + Cannon.js; {{key_interaction}}: pressing "R" rotates gravity 90°.