AGENT SKILL

phaserjs-build-scenes

Build Phaser scene, loader, camera, scale and world lifecycles with explicit ownership of shared game resources.

License 许可
MIT
最近更新
2026-11-13
Stars
★ 4
Forks
3

01 前言 Front Matter

name
phaserjs-build-scenes
engines
[ "PHASERJS" ]
description
Build Phaser scene, loader, camera, scale and world lifecycles with explicit ownership of shared game resources.

02 资源文件 2

03 SKILL.md 正文

Build Phaser Scenes

When to use

Create or refactor Phaser boot/preload/gameplay scenes, world loading or scene transitions.

Engine and dependencies

Before edits or tool launches, run resolve-engine.sh and resolve-skill.sh phaserjs-build-scenes; require compatibility and honor task override scope. Read the host's locked Phaser major/revision, renderer, plugins, world contract and budgets. Respect Phaser 3 or 4 as selected: renderer internals differ. Do not use Phaser 2/CE recipes, upgrade implicitly, install packages or inject CDN scripts.

Workflow

  1. Own one Phaser.Game per intended runtime; centralize renderer, parent, scale, physics and plugin configuration. Avoid duplicate game instances during remount/hot reload. Permanent unmount destroys the owning game.
  2. Separate boot, loading, gameplay and persistent services where their lifetimes differ. Use init, preload, create, update and Scene events deliberately. Shutdown permits restart; destroy ends scene ownership. Install restart-scoped listeners anew and release them on shutdown.
  3. Use LoaderPlugin, cache and texture keys through an asset manifest. Define missing/failed asset behavior and transition cancellation. Game-level caches, animation definitions and sound resources can outlive scenes: remove them only when their final user leaves.
  4. Configure Scale Manager and cameras with explicit logical size, viewport, safe areas and world bounds. Bound per-frame work after tab resume and separate gameplay state from display objects.
  5. Convert validated map/spawn/content IDs into runtime instances. Keep navigation, enemy decisions and versioned saves in project systems; Phaser scene objects and the global registry are not automatically a persistence schema or AI framework.
  6. Own timers, tweens, camera effects, event subscriptions and asynchronous completions. Late results must verify the scene activation token before mutation; stop scene-owned work without cancelling shared services.

Output and verification

Deliver lifecycle/configuration changes, asset ownership and world adapters. Test boot failure, restart, scene replacement during loading, shared textures, resize/orientation, pause/sleep/wake and repeated teardown. Measure load/frame/memory budgets in the actual renderer. Structural tests cannot prove visual readiness. Check the scene lifecycle and the Phaser 3/4 migration boundaries.

04 同仓库更多 Skills

TimothyMeadows
TimothyMeadows/Hephaera

verify-web3-game-lifecycle

Verify a game's selected Web3 asset, wallet, ownership and trading lifecycle with contract properties, canonical recovery, actual target evidence and separate release readiness.

★ 4
TimothyMeadows
TimothyMeadows/Hephaera

verify-onchain-game-assets

Verify exact on-chain game collection ownership and quantities at canonical blocks, reconcile inventory events, and design honest match admission. Use for ERC721/ERC1155 inventory, reorg recovery, reservations, or transfer-during-match rules.

★ 4
TimothyMeadows
TimothyMeadows/Hephaera

plan-web3-game-assets

Define an opt-in Ethereum, Base or Immutable game-asset lifecycle, including token identity, supply, rights, custody, game eligibility and chain-specific dependencies.

★ 4
TimothyMeadows
TimothyMeadows/Hephaera

integrate-game-wallets

Integrate explicit player-wallet connection, scoped SIWE authentication, authority invalidation and reviewed target-specific handoff without application-held player keys.

★ 4
TimothyMeadows
TimothyMeadows/Hephaera

integrate-game-asset-trading

Integrate explicitly selected game asset settlement with exact unsigned intents, scoped approvals, idempotent operations and canonical receipt reconciliation. Use for NFT listing, buying, cancellation, retries or marketplace integration.

★ 4
TimothyMeadows
TimothyMeadows/Hephaera

build-evm-game-contracts

Author and verify host-owned EVM game collections and explicit mint, burn, craft or admin rules with pinned Solidity tooling. Use for contract source and deployment candidates; deployment and player signing require separate authorization.

★ 4