Play Island example sources — 2026-10-27

These examples use the existing injected window.PlayIsland SDK. PIExample is an
acknowledgement-aware SAMPLE helper, not a new SDK or a local acceptance simulator.
No production credentials are included or needed in browser games.

Before testing:
1. Ask the Island team for creator access and an active provider profile.
2. Ask authorized staff to review and publish event-definitions.json for YOUR game
   in the event registry. The JSON file does nothing by itself; each definition
   must be published through the existing registry UI. New games are not auto-registered.
3. Prepare a browser build as described below. Source ZIPs are NOT upload ZIPs.
4. Save metadata/version, upload the build in /provider, open the visual package
   preview, and submit for review. That preview has no gameplay session responder.
5. After approval/publication, use /play/YOUR-SLUG to test acknowledgements with
   real gameplay. Never infer rewards from accepted events. Guest sessions earn
   no account rewards; signed-in rewards depend on server rules and caps.

Keep index.html at ZIP root and include a <head> tag for SDK injection. Bundle
assets locally. No JavaScript eval, same-origin privilege, arbitrary network,
service worker or cookie access is promised. Disable precompression unless the
current delivery stack explicitly supports it (.br/.gz/.unityweb are not allowed).
The core example requires only started/progress/completed; vanilla also shows
paused/resumed/score. All must be registered. Do not send extras or per-frame events.
Completion must occur at least 3 seconds after the server session starts; samples
wait 4 seconds after accepted start. SDK V2 sequences are strict. Reload after
rejection/timeout: blindly sending the next report creates an out-of-order error.

Saves, exit and leaderboard navigation are currently allowlisted to bundled games;
do not assume a new game can call those APIs. No universal player/profile API exists.
This source is reusable under the included MIT license. Engine dependencies retain
their own licenses and must be installed separately where specified.

Guides: /developers/docs · Live schemas: /developers/docs/event-registry
Standalone browser/editor play cannot verify platform communication.

Construct setup

Use Construct 3 scripting with Use worker = No. Add play-island.js as a script file and load client.js on the DOM before it. Create global variables PIReady (boolean), PIBusy (boolean), PIError (string) and Score (number). Import reportPlayIsland in your event-sheet scripting. On a real start await reportPlayIsland(runtime,'started',{}); on a result after at least four seconds await reportPlayIsland(runtime,'completed',{score:runtime.globalVars.Score,progress:100}). Gate input on PIReady and !PIBusy and show PIError. Export HTML5, bundle scripts locally, keep index.html at root, and disable offline/PWA features that need same-origin storage. No .c3p project or worker-mode adapter is supplied; this is an unverified integration source template.

Engine reference: https://www.construct.net/en/make-games/manuals/construct-3/scripting/scripting-reference/iruntime

Verification: Integration source adapter; the native editor/export has not been verified. Validate your actual build under Play Island's sandbox before submission.
