1498247e9f
新增 npm + Vite + Phaser 4.2.1 游戏工程脚手架 允许 DirectProject 在项目边界内安装依赖并执行构建 让预览、静态检查、投影和试玩导出统一使用 dist 产物 补充 Phaser Skill、技术方案、项目记忆和定向测试
2.7 KiB
2.7 KiB
name, description
| name | description |
|---|---|
| agc-web-game-development | Build or modify a playable npm-managed Phaser 4 web game in the current AGC project. Use for gameplay creation, bug fixes, UI or layout changes, responsive behavior, asset integration, controls, scoring, reset flows, and other HTML, CSS, JavaScript, DOM, Canvas, or WebGL work. |
AGC Web Game Development
Implement the user's actual game request in the current project as an npm-managed Phaser 4.2.1 game. Use Phaser scenes for gameplay and DOM only for deliberately external UI.
Workflow
- Read the existing package and source files before editing. New projects place
package.json,index.html,style.css, andgame.jsundergame/; existing root packages retain their layout. Run npm in that package directory (for examplenpm --prefix game ciandnpm --prefix game run build). - Keep
package.jsonandpackage-lock.jsonauthoritative. Import Phaser withimport Phaser from 'phaser'; do not copy a bundle, add an import map, or use a CDN. Other npm dependencies are allowed when the game needs them. - Build with the project's npm script before previewing. The playable entry is the package directory's
dist/index.html; never report an unbuilt bare-module page as playable. Import assets or configure public assets so all runtime media is included in dist; preview and exports cannot read outside it. - Build a complete playable loop: visible objective, responsive input, meaningful state changes, success or failure feedback, and a reliable restart path where the game needs one.
- Fit the active game scene to desktop and mobile viewports without accidental page scrollbars. Reserve deliberate safe space for HUD elements instead of covering interactive content.
- Reuse registered Taonier art when available through
agc_tools. Load media defensively and keep gameplay usable when an optional derivative is absent; never relabel a local placeholder as platform art. - Let Phaser own the render loop and input dispatch. Avoid duplicate scenes, stale event listeners, and state that survives restart unintentionally.
- After a meaningful game change, use the browser playtest Skill and fix issues shown by real evidence before reporting completion.
When implementing a new game loop or a broad gameplay revision, read references/game-quality-checklist.md.
Notes
- UI Editor's JSON formated is a special kind asset; Never edit it or read it directly. User can export to
ui/generated-<digest>.jsand want u to use it; Read it instead, the doc embedded will instruct you how to use it.
Reporting
Report the files changed, observable gameplay behavior, real validation performed, and any remaining limitation. Do not report a test or browser pass that did not run.