quick-game
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePerformance Notes
性能注意事项
- Take your time to do this thoroughly
- Quality is more important than speed
- Do not skip validation steps
- 请花时间仔细完成此操作
- 质量比速度更重要
- 不要跳过验证步骤
Quick Game (Fast Prototype)
快速游戏(快速原型)
Build a playable game prototype as fast as possible. This is without the polish — just scaffold + implement the core loop. Get something on screen, then incrementally add layers with , , , , and .
/make-game/add-assets/design-game/add-audio/game-deploy/monetize-gameWhat you'll get:
- A scaffolded game project with clean architecture
- Core gameplay — input, movement, scoring, fail condition, restart
- A running dev server you can play immediately
What you skip (run these later if you want):
- — pixel art sprites (2D) or 3D models
/add-assets - — visual polish, particles, transitions
/design-game - — music and sound effects
/add-audio - — promo video capture
/record-promo - — deploy to here.now
/game-deploy - — Play.fun integration
/monetize-game
尽快构建可玩的游戏原型。这是不带打磨环节的——仅包含脚手架搭建+核心循环实现。先呈现可运行内容,之后再通过、、、和逐步添加功能层。
/make-game/add-assets/design-game/add-audio/game-deploy/monetize-game你将获得:
- 架构清晰的脚手架游戏项目
- 核心游戏玩法——输入控制、移动、计分、失败条件、重启功能
- 可立即游玩的运行中开发服务器
你将跳过的环节(如需可后续运行):
- ——像素艺术精灵(2D)或3D模型
/add-assets - ——视觉打磨、粒子效果、过渡动画
/design-game - ——音乐和音效
/add-audio - ——宣传视频录制
/record-promo - ——部署至here.now
/game-deploy - ——集成Play.fun
/monetize-game
Instructions
操作说明
Step 0: Parse arguments
步骤0:解析参数
Parse to determine the game concept:
$ARGUMENTSDirect specification:
[2d|3d] [game-name]- Engine: (Phaser) or
2d(Three.js). If not specified, default to3d.2d - Name: kebab-case. If not specified, ask the user.
Tweet URL: If arguments contain a tweet URL (, , ):
x.com/*/status/*twitter.com/*/status/*fxtwitter.com/*/status/*- Fetch the tweet using the skill
fetch-tweet - Default to 2D
- Creatively abstract a game concept from the tweet
- Generate a kebab-case name
- Tell the user what you'll build
Meshy API Key (3D only): If 3D, check for . If missing, ask the user (link to https://app.meshy.ai). Store for model generation.
MESHY_API_KEY解析以确定游戏概念:
$ARGUMENTS直接指定格式:
[2d|3d] [game-name]- 引擎:(Phaser)或
2d(Three.js)。若未指定,默认使用3d。2d - 名称:短横线分隔格式(kebab-case)。若未指定,请询问用户。
推文链接: 若参数包含推文链接(、、):
x.com/*/status/*twitter.com/*/status/*fxtwitter.com/*/status/*- 使用技能获取推文内容
fetch-tweet - 默认使用2D引擎
- 从推文中创造性提炼游戏概念
- 生成短横线分隔格式的名称
- 告知用户你将构建的内容
Meshy API密钥(仅3D可用): 若使用3D引擎,请检查是否存在。若缺失,请询问用户(链接至https://app.meshy.ai)。保存密钥用于模型生成。
MESHY_API_KEYStep 1: Scaffold + Implement
步骤1:搭建脚手架 + 实现功能
Infrastructure (main thread):
- Locate the template directory — check or
~/.claude/plugins/cache/local-plugins/game-creator/*/templates/relative to this plugintemplates/ - Target directory: If inside the repo, create in
game-creator. Otherwise, create inexamples/<game-name>/../<game-name>/ - Copy the template:
- 2D: → target
templates/phaser-2d/ - 3D: → target
templates/threejs-3d/
- 2D:
- Update name and
package.jsontitleindex.html - Run
npm install - Start the dev server () in the background. Check port availability first — if 3000 is taken, try 3001, 3002, etc.
npm run dev
Game implementation (subagent via Task):
Launch a subagent with:
TaskYou are building a quick game prototype. Speed is the priority — get a playable core loop working.Project path:Engine:<project-dir>Game concept:<2d|3d>Skill to load:<description>(2D) orphaser(3D)threejs-gameImplement in this order:
- Input (touch + keyboard from the start)
- Player movement / core mechanic
- Fail condition (death, collision, timer)
- Scoring
- Restart flow (GameState.reset() → clean slate)
Scope: 1 scene, 1 mechanic, 1 fail condition. Keep it tight.Rules:
- All cross-module communication via EventBus
- All magic numbers in Constants.js
- No title screen — boot directly into gameplay
- No in-game score HUD — Play.fun widget handles score display
- Mobile-first input: touch + keyboard, use unified InputSystem pattern
- Import
from Constants.js — keep UI belowSAFE_ZONESAFE_ZONE.TOP- Minimum 7-8% canvas width for collectibles/hazards
- Character sizing:
toGAME.WIDTH * 0.12for character-driven gamesGAME.WIDTH * 0.15- Preserve the template's
helper in GameOverScene — do NOT rewrite itcreateButton()- Wire spectacle events:
,SPECTACLE_ENTRANCE,SPECTACLE_ACTION,SPECTACLE_HIT,SPECTACLE_COMBO,SPECTACLE_STREAKSPECTACLE_NEAR_MISS- Add
to GameState for future audio supportisMuted- Ensure restart is clean — 3 restarts in a row should work identically
基础架构(主线程):
- 定位模板目录——检查或此插件相对路径下的
~/.claude/plugins/cache/local-plugins/game-creator/*/templates/templates/ - 目标目录:若在仓库内,创建于
game-creator。否则,创建于examples/<game-name>/。./<game-name>/ - 复制模板:
- 2D:→ 目标目录
templates/phaser-2d/ - 3D:→ 目标目录
templates/threejs-3d/
- 2D:
- 更新中的名称和
package.json中的标题index.html - 运行
npm install - 在后台启动开发服务器()。首先检查端口可用性——若3000端口被占用,尝试3001、3002等。
npm run dev
游戏实现(通过Task子代理):
启动子代理并传入以下内容:
Task你正在构建一个快速游戏原型。速度是首要目标——确保可玩的核心循环正常运行。项目路径:引擎:<project-dir>游戏概念:<2d|3d>需加载的技能:<description>(2D)或phaser(3D)threejs-game实现顺序:
- 输入控制(从一开始就支持触摸+键盘)
- 玩家移动 / 核心机制
- 失败条件(死亡、碰撞、计时器)
- 计分系统
- 重启流程(GameState.reset() → 重置状态)
范围:1个场景、1种核心机制、1个失败条件。保持精简。规则:
- 所有跨模块通信通过EventBus实现
- 所有魔法数值存于Constants.js
- 无标题界面——直接进入游戏玩法
- 无游戏内计分HUD——由Play.fun组件处理分数显示
- 移动端优先的输入:触摸+键盘,使用统一的InputSystem模式
- 从Constants.js导入
——确保UI位于SAFE_ZONE下方SAFE_ZONE.TOP- 可收集物/危险物的最小宽度为画布宽度的7-8%
- 角色尺寸:角色驱动类游戏中为
至GAME.WIDTH * 0.12GAME.WIDTH * 0.15- 保留GameOverScene中的
辅助函数——请勿重写createButton()- 绑定 spectacle 事件:
、SPECTACLE_ENTRANCE、SPECTACLE_ACTION、SPECTACLE_HIT、SPECTACLE_COMBO、SPECTACLE_STREAKSPECTACLE_NEAR_MISS- 为GameState添加
属性以支持未来的音频功能isMuted- 确保重启功能正常——连续3次重启应效果一致
Step 2: Verify
步骤2:验证
After the subagent returns:
- Run in the project directory to confirm no errors
npm run build - If the build fails, fix the issues (up to 2 retries)
- If Playwright MCP is available, navigate to the dev server, take a screenshot, and do a quick visual check
子代理返回结果后:
- 在项目目录中运行以确认无错误
npm run build - 若构建失败,修复问题(最多重试2次)
- 若Playwright MCP可用,导航至开发服务器,截取屏幕截图并进行快速视觉检查
Example Usage
示例用法
2D game
2D游戏
/quick-game 2d asteroid-dodgeResult: Copies Phaser template → implements player ship, asteroid spawning, collision death, score counter, restart flow → dev server running at localhost:3000 in ~2 minutes. Shapes only, no polish.
/quick-game 2d asteroid-dodge结果:复制Phaser模板→实现玩家飞船、小行星生成、碰撞死亡、计分器、重启流程→开发服务器在localhost:3000运行,耗时约2分钟。仅包含基础图形,无打磨效果。
From tweet
基于推文
/quick-game https://x.com/user/status/123456Result: Fetches tweet → abstracts game concept → scaffolds and implements a playable prototype inspired by the tweet content.
/quick-game https://x.com/user/status/123456结果:获取推文内容→提炼游戏概念→搭建脚手架并实现受推文内容启发的可玩原型。
Troubleshooting
故障排除
Game scaffolds but won't start
游戏已搭建但无法启动
Cause: Vite config or import paths incorrect.
Fix: Verify vite.config.js has correct root. Check that main.js is referenced in index.html.
原因: Vite配置或导入路径错误。
修复: 验证vite.config.js中的根目录是否正确。检查index.html中是否正确引用main.js。
Missing core files
核心文件缺失
Cause: Scaffold skipped EventBus/GameState/Constants.
Fix: Every game needs core/EventBus.js, core/GameState.js, core/Constants.js. Re-run scaffold or create manually.
原因: 脚手架过程中跳过了EventBus/GameState/Constants。
修复: 每个游戏都需要core/EventBus.js、core/GameState.js、core/Constants.js。重新运行脚手架或手动创建。
Done
完成
Tell the user:
Your game is running at. Open it in a browser to play!http://localhost:<port>To keep building, run these commands:
— replace shapes with pixel art sprites/add-assets — add visual polish (particles, gradients, juice)/design-game — add music and sound effects/add-audio — deploy to the web/game-deploy — add Play.fun integration/monetize-gameOr runnext time for the full pipeline./make-game
告知用户:
你的游戏正在运行。在浏览器中打开即可游玩!http://localhost:<port>如需继续开发,请运行以下命令:
——将基础图形替换为像素艺术精灵/add-assets ——添加视觉打磨效果(粒子、渐变、润色)/design-game ——添加音乐和音效/add-audio ——部署至网页/game-deploy ——集成Play.fun/monetize-game下次如需完整流程,请运行。/make-game