flip-phaser-starter

Installation
SKILL.md

Flip: Phaser Starter

Flip recommends Phaser 4.2.1 for 2D. Run flip init --template phaser --dir NEW_DIR (Star Drop). Read the starter's AGENTS.md first.

  • Import * as Phaser from './flip-phaser-4.2.1.js'. Flip serves it with its core beside the game. Never commit Phaser, use a CDN or import 'phaser'. Write Phaser 4 APIs.
  • The sandboxed frame needs input: { windowEvents: false } and loader: { imageLoadType: 'HTMLImageElement', crossOrigin: 'anonymous' }.
  • Script, plugin and scene-file loaders and DOMElement HTML are disabled (ENGINE_FEATURE_DISABLED). Load images, atlases, audio and JSON only.
  • Controls: Flip's page owns the gamepad and streams flip.on('input') events. The starter's pad.js turns them into per-frame presses: pad.attach(flip) once, then pad.poll() in update(). Map the stick or D-pad to movement and primary or menu to the main action. Never call navigator.getGamepads(). Call this.sound.unlock() in flip.on('audioUnlock', …).
  • Test bridge: setSeed(n) calls game.loop.sleep() and Phaser.Math.RND.sow([String(n)]). reset() sleeps the loop, restores the view and calls scene.restart(). step(ms) calls game.step(t += ms, ms). snapshot() returns the view plus key sprite positions. Two seeded runs should give identical JSON for repeatable browser tests; inconsistent results only warn.
  • Call signalStart() only once the scene exists and the SDK is connected (markPlayable in the starter).
  • Decoration may use Phaser.Math.RND; outcomes come from game.server.js via ctx.sdk.requestRandomness.
  • Text drawn on the canvas cannot satisfy assertText; mirror important state in DOM text or snapshot() and assert it with assertState.

Guide: https://flip-sdk-proposal.vercel.app/sdk/guides/phaser.md

Installs
1
First Seen
10 days ago