Files
T
kdletters 1498247e9f
Project CI / Repository checks (push) Successful in 2m54s
Project CI / Native shell tests (push) Failing after 16m56s
Project CI / Frontend tests (push) Successful in 3m4s
Project CI / Backend tests (push) Successful in 8m10s
AGC产物迁移npm与Phaser4
新增 npm + Vite + Phaser 4.2.1 游戏工程脚手架

允许 DirectProject 在项目边界内安装依赖并执行构建

让预览、静态检查、投影和试玩导出统一使用 dist 产物

补充 Phaser Skill、技术方案、项目记忆和定向测试
2026-09-08 15:11:36 +08:00

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

  1. Read the existing package and source files before editing. New projects place package.json, index.html, style.css, and game.js under game/; existing root packages retain their layout. Run npm in that package directory (for example npm --prefix game ci and npm --prefix game run build).
  2. Keep package.json and package-lock.json authoritative. Import Phaser with import 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. Let Phaser own the render loop and input dispatch. Avoid duplicate scenes, stale event listeners, and state that survives restart unintentionally.
  8. 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>.js and 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.