# Playable ads — the OpenMotion recipe Read this when the brief says **Format: playable ad** (Studio's playable-ad switch, or a prompt that asks for a playable / interactive ad). It replaces the title-screen and session rules of [genre recipes](game-genres.md) for this format; everything else in the [game flow](game-flow.md), the [design system](game-design-system.md), [style](game-stylization.md) and [audio](game-audio.md) still applies. Score the result with the playable-ad addendum of the [rubric](review-rubric.md). A playable ad is a 30–60 second slice of a game that sells the full game by letting the viewer play it. The viewer did not choose to open it, may never have played a game like it and will leave within seconds if nothing happens. Every rule below serves one of three goals: **the first touch already plays**, **the player wins something early and almost loses later**, and **the end card makes tapping the call-to-action (CTA) the obvious next step**. ## 1. Mode rules (all mandatory) 1. **Single player, portrait.** Studio creates a playable ad only as a portrait, single-player brief. Design for a 390×844 CSS-pixel phone held upright, scale that design space to whatever container the ad gets, and keep the full playfield visible in 9:16, 9:19.5, 3:4 and landscape containers (letterbox with scene colour, never black bars). 2. **Clean local runtime (no third-party CDNs).** Focus authoring effort on rich multi-level progression and crisp readability — visuals can stay lightweight and clean. Keep the standard OpenMotion project layout (`index.html`, `logic.js`, `client.js`, `style.css`) and embed generated library assets (such as looping BGM or optional focal art) through standard literal `/motion-api/assets//versions//media` URLs, which `web_publish` and `exportZip` bundle automatically. Never load external CDNs, remote web fonts, third-party scripts, or unapproved remote URLs. (Only collapse into a single inlined HTML file with zero local asset requests if the user explicitly asks to package for an external ad network per section 9.) The service-owned `game.json` holds metadata only (title, controls, cover) and is edited through `openmotion_game_update_meta`. 3. **No storage, no dialogs, no navigation.** No `localStorage`, `sessionStorage`, cookies, `alert`, `confirm`, `prompt`, `location.href = …` or `location.reload()`. The arcade-2d kit's best-score storage is removed in an ad build. Replay is an in-memory reset. 4. **Sound after the first touch.** Create or resume the `AudioContext` inside the first pointer or key handler. Nothing plays before it. 5. **The CTA is a function, not a link.** Every store tap goes through one `openStore()` (section 3.4). Nothing opens the store automatically, on the first touch, on Replay or on a timer. 6. **No title screen.** The scene, the player object and an animated hand are on screen at the first rendered frame. The first touch anywhere on the playfield starts play and counts as a correct first move. 7. **Tunables in one block.** Every number, colour, string and URL a marketer may change lives in the single `config` object at the top of `logic.js` (section 4). Game code reads values from it, never from literals. 8. **Deterministic rules.** Keep the kit's six exports, `pilot`, `referenceRoute` and `summarize`. `openmotion_game_simulate` must show the reference route winning the last level and idle losing (section 10). 9. **Language.** English in code, comments and file names. Ship strings for `en`, `zh-CN` and `es`; pick by `?lang=`, then `config.lang`, then `navigator.language`, then `en`. ## 2. Start from the arcade-2d kit A playable-ad brief receives `templates/game-kits/arcade-2d/` (it already supports `ORIENTATION = 'portrait'` and a 9×16 world). Keep its fixed-step loop over `logic.js`, input layer, juice helpers (`burst`, popups, shake, hit-stop, `audio.blip`), pause-on-blur, `?debug` stats and the `window.__omGame` test hook. Replace or change these parts: | Kit part | In a playable ad | |---|---| | Sample rules in `logic.js` (sparks and rocks) | The genre's rules from section 8, organised as levels (`config.levels`) with a phase machine `playing → clear → playing … → win`, or `loss` | | `config` at the top of `logic.js` | The single tunables block of section 4 (gameplay, palette, CTA, store links, strings) | | `STRINGS`, `PALETTE` in `client.js` | Read from `L.config.strings` and `L.config.palette`; delete the client copies | | `#card` title card and `#start` button | Removed. Add `#hand` (tutorial), `#hud` regions, `#cta-dock` (persistent CTA) and `#end` (end card) | | `begin()` on Enter/Space or a canvas tap | Any pointer down on the playfield or any key starts play (no button) | | `#mute` in the top-right corner | Move it out of both 56×56 px top corners (networks place their close button there): top row, inset 64 px from the left, or into the bottom dock | | `localStorage` best score | Removed; show the run's score only | | `showEnd()` | The end card of section 3.3 with Play again and the CTA | | `?autostart` | Keep: headless capture uses it to see gameplay instead of the intro | **File plan:** Keep the standard modular files — `logic.js` (rules and tunables), `client.js` (presentation, input, ad hooks), `style.css`, and `index.html` referencing them — so `openmotion_game_validate`, `simulate`, `playtest`, `web_publish`, `exportZip`, and `/motion-api/assets/...` media URLs work cleanly on every edit. **Optional single-file packaging (only when explicitly requested for an external ad network):** If the user specifically asks for a single-file ad-network upload (e.g. AppLovin/Meta/MRAID), you may produce an inlined `index.html` bundle without external/local network fetches (using procedural visuals and WebAudio SFX + looping BGM so no base64 binaries need to be written by hand): ```html Coin Drop Rescue
``` - Use a classic `