跳到正文
Bonsai 🌳· 来源· @bonsaixbt · X·· 6 天前精选AI 评分70
推荐理由

原文给出了让 Claude Code 通过截图和 DOM 数据闭环调试 Three.js 游戏的具体 Prompt 与代码模式。

正文 · 原文

Claude Code is building your 3D game blind

when it checks the game in a browser, Playwright MCP gives it the page tree. a Three.js game in that tree is one word: canvas. no hero, no floor, no bug

that's how you get "fixed" on a hero that still spawns underground

make it do 4 things before it says done:

  1. look: browser_take_screenshot after every change. real pixels, not the tree
  2. read: put hero position, current animation and fps in window.__game. browser_evaluate reads them as numbers
  3. check: browser_console_messages. a broken model file shows up there first
  4. move: press_key only taps a key. add a walk() helper so walking can actually be tested

screenshot, numbers and console agree → next change. not before

the CLAUDE.md block and the prompt are in the reply

the loop checks the game. the hero walking around in it comes from my 3d game hero guide ↓

引用Bonsai 🌳@bonsaixbt
https://x.com/i/article/2116537402277642240
在 X 查看被引用的帖子

来源:Bonsai 🌳 · x.com