jpskill.com
🛠️ 開発・MCP コミュニティ

phaser-design-patterns

Design pattern implementation in Phaser 3 with JavaScript, focused on scene architecture, entities, input, physics, and performance. Use when asked to apply, refactor, review, or teach design patterns (creational, structural, or behavioral) in Phaser games.

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o phaser-design-patterns.zip https://jpskill.com/download/10598.zip && unzip -o phaser-design-patterns.zip && rm phaser-design-patterns.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/10598.zip -OutFile "$d\phaser-design-patterns.zip"; Expand-Archive "$d\phaser-design-patterns.zip" -DestinationPath $d -Force; ri "$d\phaser-design-patterns.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して phaser-design-patterns.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → phaser-design-patterns フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1
📖 Claude が読む原文 SKILL.md(中身を展開)

この本文は AI(Claude)が読むための原文(英語または中国語)です。日本語訳は順次追加中。

Phaser Design Patterns

Implement design patterns with a focus on real gameplay, not abstract examples.

When to use

Use this skill when the user needs to apply, refactor, review, or explain design patterns in Phaser 3 (JavaScript), especially for scene architecture, entities, input systems, physics interactions, and performance-sensitive gameplay code.

Workflow

  1. Identify a real game problem (entity creation, system coordination, behavior variation, etc).
  2. Choose a pattern that reduces coupling and does not add unnecessary complexity.
  3. Map the pattern to Phaser primitives (Scene, GameObject, Group, Events, Physics, Time, Input).
  4. Implement in JavaScript using game-domain naming.
  5. Validate at runtime (scene loads, input responds, collisions work, no event leaks).

Quick Pattern Selection

  • Variable entity creation -> Factory Method / Abstract Factory.
  • Step-by-step level or UI construction -> Builder.
  • Shared state for thousands of instances -> Flyweight + pooling.
  • Rules by AI mode/behavior -> State / Strategy.
  • Decoupled events between gameplay and UI -> Observer / Mediator.
  • Re-runnable actions (input, replay, undo) -> Command.

Implementation Rules

  • Prioritize composition over deep inheritance.
  • Keep scenes small and with clear responsibilities.
  • Avoid mutable singletons for gameplay logic; reserve them for global services (audio, config).
  • Use delta in update(time, delta) when the pattern affects movement or timers.
  • Unsubscribe events in shutdown/destroy to avoid memory leaks.
  • For massive objects (bullets, particles), combine the pattern with pooling (setActive(false), setVisible(false)).

Expected Deliverables

  • Explain in 2-4 lines why the pattern solves the problem.
  • Show a JavaScript/Phaser snippet with real game context.
  • Include relevant risks and anti-patterns.
  • Propose minimum validation (manual test or simple test).

References

  • See references/patterns-map.md for a complete pattern -> Phaser usage map.
  • See references/phaser-snippets.md for ready-to-copy and adapt templates.
  • See references/state-machine-pattern-phaser.md for a full State + StateMachine implementation (Idle/Move/Action) adapted to Phaser.