flip-game-sdk

Installation
SKILL.md

Flip: Game SDK

Flip's browser bridge is ./flip-runtime-v1.js. Flip serves it beside every game, so never commit or replace it. The manifest is flip.json (version 2). Full reference: https://flip-sdk-proposal.vercel.app/llms-full.txt. Read https://flip-sdk-proposal.vercel.app/sdk/openapi.json before writing any HTTP call.

import { createGameSDK } from './flip-runtime-v1.js';
const flip = await createGameSDK({ results: 'return' }); // the only allowed option
if (!flip.context.configured) throw new Error(flip.context.configurationError);
flip.registerTestHook({ snapshot, reset, setSeed, step }); // flip.test.* for the playtest
flip.on('input', ({ input }) => steer(input.moveX, input.moveY, input.primary)); // Flip's pad and controllers
flip.signalStart();
const requestId = crypto.randomUUID();
const r = await flip.sendGameAction({ action: 'play', payload: { pick: 2 }, requestId });
if (r.ok) { show(r.result, r.state, r.sharedState); flip.signalSettle({ requestId }); flip.signalGameOver({ score }); }
else if (r.retryable) retrySameRequest(); else showError(r.reason);

Results. Every write returns {ok, code, reason}. With results: 'return', reads also resolve that way and nothing throws. Without it, failures reject with error.ok === false, error.code and error.reason. retryable (TIMEOUT, STATE_CHANGED, busy codes) means: retry with the same requestId and identical inputs.

Installs
1
First Seen
10 days ago