HTML5Canvas 2DWeb AudioMRAIDPlayable ad
Controls
- Drag back from the ball and let go to shoot: the farther you pull, the harder the shot; the first touch starts the ad clock
- Keyboard: arrow keys aim, hold Space to charge the power and release to shoot
- The dotted line shows the first bounce; sand slows the ball, water costs a stroke and the windmill blades knock it away
- Two holes, par 2 and par 3; finish both for the end card
- The Install button is always on screen and calls the exit API of the chosen network; the end card comes up after the second hole or at 30 seconds of play
- Pick AppLovin, Unity, Google Ads, Meta or Browser to change the mock SDK the ad runs against
- Rotate switches the phone between portrait and landscape; Hide ad simulates the ad leaving the screen so it pauses and mutes; Backup shows the static image
- The mute button in the corner silences everything; sound starts only after your first touch
Works in current Chrome, Safari and Firefox on phones and desktops; Canvas 2D and Web Audio in a sandboxed frame, no WebGL and no external requests, one small HTML file. Sound needs a tap to start, as every browser requires. Respects the reduced-motion setting: no screen shake, fewer particles and a still hint. The ad-network SDKs on the page are mocks with the real names and call shapes. Fairway Flick is a fictional game made for this example.
Questions
Is Fairway Flick a real game?
No. It is a fictional game in the style of aim-and-shoot sports ads.
How do you shoot?
Drag back from the ball and let go; a dotted preview shows the path to the first bounce.
How many holes are there?
Two: a par 2 with a wall, a bumper, sand and water, and a par 3 with a windmill bar to time.
Does it use external files?
No. It is one HTML file with no image or audio file and no external request.
How it’s built
A sling-shot mini-golf playable, the aim-and-shoot sports pattern behind Golf Battle, Carrom Pool, 8 Ball Pool and Basketball Stars ads (sports are among the biggest themes on the 67 playables 24Play lists on its playable-ads page). It is built the way ad networks take playables: one self-contained HTML file that starts when the network says it is ready, is playable at once and ends on an install card. The page runs it inside a phone on a mock ad network, so every rule a network checks is visible while it plays. Fairway Flick is a fictional game made for this example.
The playable
- Source in
src/playables/fairway-flick/, built by node scripts/build-playable.mjs fairway-flick into public/lab/ads/fairway-flick/index.html: one file with the script and styles inlined, no image or audio file, no external request. backup.jpg is a frame of the ad itself. - Flow: drag back from the ball and let go; the dotted preview follows the shot to its first bounce. Hole 1 (par 2) has a wedge wall, a bumper, sand and water; hole 2 (par 3) adds a windmill bar that has to be timed. Sand slows the ball, water costs a stroke and resets it. A hole in one gets a banner and confetti; the end card is a scorecard with up to three stars. It is forced 30 s after the first touch.
- All rules are in
logic.ts (unit-tested): a fixed 120 Hz physics step (so a scripted shot always plays the same), collisions against segments and circles, friction and the sand, water and cup rules, the trajectory preview, scoring and stars. A test plans a hole-in-two for hole 2. - Keyboard: arrow keys aim, hold Space to charge the power and release to shoot. Reduced motion: no shake, fewer particles, a still hint.
- Sound is Web Audio effects only (
src/playables/shared/sfx.ts), started by the first gesture, with a mute button.
Network behaviour
- Shared with the other 2D playables in
src/playables/shared/host.ts: the ad waits for the SDK (MRAID ready, then viewable), pauses when it is not viewable, and the Install button calls mraid.open(url), ExitApi.exit(), FbPlayableAd.onCTAClick() and finally window.open(clickTag). - It reports shots, bounces, holes, the outcome, the end card and install taps with
postMessage; the preview lists the numbers carried in detail.stats.
The preview page
- The phone, mock SDKs, ad clock, session counters and ad-ops checklist are the shared
PlayablePreview component (src/components/lab/playable-preview/); this folder only passes the copy, the theme and the four counters.
Honest limits
- The SDKs are mocks with the real names and call shapes, not the networks' own code. Check each network's current size limit and review rules before trafficking.
- The store link is a placeholder search on Google Play, because the game does not exist.
- Difficulty was not tuned on real players; the sound could not be judged by ear in an automated run.