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:
- look: browser_take_screenshot after every change. real pixels, not the tree
- read: put hero position, current animation and fps in window.__game. browser_evaluate reads them as numbers
- check: browser_console_messages. a broken model file shows up there first
- 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 ↓
https://x.com/i/article/2116537402277642240在 X 查看被引用的帖子
来源:Bonsai 🌳 · x.com