Docs

Add a game

Smashi Arcade hosts browser games built by AI models. Each build is published with the prompt, model, harness and build time behind it. This page is the full set of rules for adding one. Its last section covers the site's own files, sound and tools.

How a build appears

Approved contributors only. Games are added by people the arcade has approved. To become one, or to suggest a game, message us at play@smashi.app.

A build is one game made by one model from one prompt. It is a folder of static files on the site, plus one entry in the games list. Builds with the same title are one game. The site reads the list and shows the build in these places:

  • Library card: the cover, the title, the score once the build has votes, model / harness and a Play button. The prompt is not on the card: it is in Build details and on the build's page.
  • Pick your game: the carousel on the home page shows one game at a time, best scored first: the game's name over a cover, the prompt its builds were made from with a button to copy it, a button that plays one of its builds at random, and a link to the game's page, where every build with the same title is side by side so models can be compared on the same game.
  • Builds page: every build on one page at /builds/, with filters for the game, model, harness and effort, and an order by score or build time.
  • Model and harness pages: /models/<model>/ and /harnesses/<harness>/ gather a model's or a harness's builds, with the games, build times and average score, under the emblem of its maker. The first build with a new model or harness starts its page.
  • Build details: the summary, model, harness, reasoning effort, time to build, genre, build date and the full prompt.
  • Game page: every build of the game side by side at /games/<game>/, with the prompt they were given. <game> is the title in lowercase with hyphens: Cadillacs and Dinosaurs is at /games/cadillacs-and-dinosaurs/. The first build of a new title starts its game page.
  • Score: visitors rate each build from 1 to 5 stars on its page and in Build details. Cards show the average, and a game page lists its builds best first.
  • Build page: the same details as Build details on a page of its own, under its game, at /games/<game>/<id>/, with a share image made from the cover. Publish writes the pages and the images; you do not.

Play opens the build at /arcade/<id>/ in its own browser window, and the site's own music stops until the visitor comes back, so the game has the speakers to itself. The link to share is the build page, https://smashi.app/games/<game>/<id>/: chat apps and social sites show its share image, with the game's title, the model, the harness and the build time. The game page has a share image too, with the number of builds and who built them. https://smashi.app/#play/<id> goes straight to the game.

Quick start

Only approved contributors can add a game: you need shell access to the server, which comes with approval. Ask at play@smashi.app. The site lives in one home directory; run every command from there.

  1. Build the game as a folder of static files with index.html at its root. It has to meet the game rules.
  2. Pick an id and add the cover: assets/cover.webp, 1280 × 720.
  3. Copy the folder to public/arcade/<id>/.
  4. Add your entry as the first item in public/arcade/games.js.
  5. Run node tools/arcade.mjs check <id> and fix every error.
  6. Run node tools/arcade.mjs publish.
  7. Open https://smashi.app/games/<game>/<id>/, press Play and finish one round.
public/
The source. Work here.
arcade/games.js
The games list.
arcade/<id>/
One folder per build.
games/<game>/
The game's page, share image and cover, with a folder per build inside: <id>/, the build's page and share image. Publish writes them all.
public_html/
The live site. Never edit it: publish writes it.
tools/arcade.mjs
Check, build and publish. tools/page.html is the frame of the build pages. The other tools are the site's own: see The site itself.
.deployments/
A snapshot of every publish, and the publish lock.

Game rules

Every build has to meet the rules marked Must. The ones marked Should are expected unless there is a reason not to.

  1. MustStatic files only

    HTML, CSS, JavaScript and media. No server code, no database, nothing to install or build on the server. If you used a bundler, publish its output.

  2. Mustindex.html at the folder root

    Opening /arcade/<id>/ starts the game. The page has <!doctype html>, a lang on <html>, <meta charset="utf-8">, a viewport meta tag and a <title> with the game's name.

  3. MustRelative paths

    Load every file by a relative path such as assets/hero.png or ./game.js, never one that starts with /. A plain link back to the arcade, <a href="/">, is fine.

  4. MustNothing from other sites

    No CDN scripts, hosted fonts, analytics, ads, remote APIs or web sockets. Put fonts and libraries in the folder, with their license text in assets/licenses/.

  5. MustFits its window

    Play opens the game in its own window, or a new tab on phones. The game fills that window at any size from 320 × 480 up, in portrait and landscape, and the page never scrolls in either direction. Scale the play area to the window instead of assuming a size.

  6. MustKeyboard and touch

    Playable from start to finish with a keyboard alone, and with touch alone on a phone, using on-screen buttons or gestures. Show the controls before play starts.

  7. MustStart, end, restart

    A start screen, a clear win or lose state, and a way to play again without reloading the page.

  8. MustQuiet until asked

    No sound before the player's first key press or tap.

  9. MustOwn storage keys only

    All builds share one origin, so they share localStorage. Start every key with your id, for example <id>:best. Never call localStorage.clear() or sessionStorage.clear(), and never touch keys that start with arcade-: those are the site's.

  10. MustNo service workers, cookies or permission prompts

    That includes camera, microphone, location and notification requests.

  11. MustSize

    The whole folder is 5 MB or less, and no single file is over 2 MB.

  12. MustYour own material

    Use only art, sound, fonts and code that were made for the build or that you may redistribute. Do not copy sprites, music or logos from existing games.

  13. MustLeave everything else alone

    A build never loads or changes files outside its folder: not another build, not the site's styles or scripts.

  14. ShouldRun everywhere

    Current Chrome, Firefox and Safari, on desktop and on phones.

  15. ShouldStay smooth

    Hold 60 frames per second on a mid-range phone, and stop the game loop while the tab is hidden.

  16. ShouldGive the player control

    A pause key, a mute control when there is sound, and no screen shake or flashing when the system asks for reduced motion.

  17. ShouldDescribe itself

    A one-sentence <meta name="description"> in index.html.

Folder and id

The id names the folder, the URL and the entry. It is 3 to 40 characters: lowercase letters, digits and single hyphens, starting with a letter. It has to be unique and it never changes after publishing. The usual shape is the build's own name plus the model: fossil-fury-opus, saltline-brawl-fable.

index.html
Required. The game.
assets/cover.webp
Required. The cover image.
assets/...
Everything else the game loads.
assets/licenses/
License texts for third-party fonts, code or art.

Scripts and styles may sit next to index.html or in subfolders. Leave out source maps, editor files, node_modules and anything else the game does not load.

Cover image

  • File: assets/cover.webp, in WebP format.
  • Size: exactly 1280 × 720 pixels (16:9), 200 KB or less.
  • Content: a screenshot or title art of this build. It shows what the player will actually get.
  • Safe area: cards crop the cover to 2:1 and the build details to 5:2, both centred, so up to 15% can be cut from the top and from the bottom. Keep the subject and any title in the middle 70% of the height. The game's cover on the home page is a mosaic of its builds' covers, each cropped from the centre.
  • Share image: publish makes it from the cover, 1200 × 630, and writes the game's title, the model, the harness and the build time over the lower half. Whatever sits in the upper half of the cover is what shows.
  • No borders, letterboxing, small text or watermarks.
Make it from a screenshot, on the server
cwebp -q 80 -resize 1280 720 screenshot.png -o assets/cover.webp

Games list entry

The games list is public/arcade/games.js, an ES module that exports an array named games. Add your entry as the first item of the array: the list order is the library order, newest first. Do not reorder or reformat the other entries.

Entry template
{
  "id": "your-build-id",
  "title": "Game Title",
  "genre": "Platformer",
  "summary": "One sentence about what the player does in this build.",
  "prompt": "The prompt, word for word.",
  "model": "Model Name 1.0",
  "reasoningEffort": "High",
  "sourceUrl": "https://github.com/you/your-build",
  "harness": "Harness Name",
  "buildSeconds": 754,
  "builtAt": "2026-11-20T14:05:00Z",
  "entry": "/arcade/your-build-id/",
  "image": "/arcade/your-build-id/assets/cover.webp"
},

Fields

idRequiredString

The folder name, as described under Folder and id. Unique, and never changed after publishing.

titleRequiredString

The name of the game the prompt asked for. Every build of the same game uses exactly the same title, because builds are grouped by it and the game page's address is made from it. A name the build gave itself belongs in summary.

genreOptionalString, 24 characters at most

In sentence case, like Racing or Beat ’em up. Reuse a genre that is already in the list when it fits.

summaryRequiredString, 160 characters at most

One sentence on what the player does in this build. If the build has its own name, start with it: Fossil Fury: fight poachers and raptors down the Overgrown Highway.

promptRequiredString

The message that asked for this build, word for word, typos included. Do not shorten, translate or improve it. Write a line break as \n.

modelRequiredString

The model's public name and version, as the harness shows it: Claude Opus 5.5, GPT-6.2 Astra. If the model is already in the list, copy its spelling exactly. Builds are grouped by the exact text, and the check rejects a second spelling.

reasoningEffortOptionalString

Only when the harness has a reasoning or effort setting: its value, capitalised, like Low, Medium or High. Otherwise leave the field out.

sourceUrlOptionalString, an https:// address

Where the build's code is public, such as its GitHub repository: https://github.com/you/your-build. The build page and Build details then show a Source code button. Builds are meant to be open source, but the link can be added later: leave the field out until the code is public.

harnessRequiredString

The tool the model ran in. Use the product name without a version: Claude Code, Codex. Copy the spelling of an existing entry when there is one.

buildSecondsRequiredWhole number above 0

The time to build, in seconds. Recording the build says what counts.

builtAtRequiredString, ISO 8601 in UTC

When the build finished: 2026-11-20T14:05:00Z. It cannot be in the future.

entryRequiredString

Always /arcade/<id>/.

imageRequiredString

Always /arcade/<id>/assets/cover.webp.

There are no other fields: the check warns about unknown ones and the site ignores them. A new entry cannot use null.

Older entries look different. Builds published before 20 November 2026 predate these rules, so some have null for the harness or build time. Do not copy their shape.

Recording the build

The library exists to compare models, so an entry has to describe the run that actually produced the files.

  • Prompt: copy it from the conversation, exactly as it was sent.
  • Model and reasoning effort: the ones that were selected in the harness for this run.
  • Harness: the tool the model ran in, not the company that makes the model.
  • Time to build: start the clock when the prompt is sent and stop it when the model says the game is finished. Everything in between counts: planning, writing, running, testing and fixing. Making the cover, writing the entry and publishing do not count. If the harness reports how long the run took, use that number. Give it in whole seconds: 12 min 34 s is 754.
  • Build date: the moment the clock stopped, in UTC.

Check and publish

One tool checks a build against this page and puts it live. It needs Node 18 or newer and no packages. If node is not on your path, use ~/.local/bin/node. Share images are drawn with ImageMagick's convert, which the server has.

node tools/arcade.mjs check <id>
Check one build.
node tools/arcade.mjs check
Check every build.
node tools/arcade.mjs publish --dry-run
List what would go live.
node tools/arcade.mjs publish
Go live.

What publish does

  1. Runs the check, and stops if there is any error.
  2. Rewrites the generated files in public/: sitemap.xml, llms.txt, and the build list, counts and structured data inside index.html. It also stamps every link to the site's styles and scripts with a short hash of the file, and puts the music track's address on the Music switch.
  3. Writes a page for every game, games/<game>/index.html, and for every build, games/<game>/<id>/index.html, and draws a share.jpg beside each, and a cover.jpg for each game. An image is drawn again only when the cover or the words on it changed. It also writes /builds/ and the pages under /models/ and /harnesses/. Builds published before 20 November 2026 had their page at /games/<id>/; a page stays there that forwards to the new address.
  4. Waits for the publish lock, so two publishes never overlap.
  5. Saves every live file it is about to replace in .deployments/publish-<time>/before/.
  6. Copies new and changed files from public/ to public_html/, with index.html last. It never deletes a live file, and it skips build folders that have no entry.

What the check covers

  • Always an error: the list does not parse; a required field is missing or has the wrong type; the id is malformed or used twice; entry or image does not match the id; the folder, index.html or the cover is missing; the cover is not WebP; builtAt is invalid or in the future; one title, model or harness is spelled two ways; two titles, or an id and another game's title, would get the same address under /games/; the folder holds server-side code or node_modules; the code clears storage, registers a service worker, sets a cookie or asks for a browser permission.
  • An error for new builds: harness or buildSeconds is null; the cover is not 1280 × 720 or is over 200 KB; the folder is over 5 MB or a file is over 2 MB; something is loaded from another site or by a path starting with /; there is no touch or pointer input; the page is missing its doctype, lang, charset, viewport or title; summary or genre is too long; builtAt is not in UTC. Builds published before 20 November 2026 get a warning instead.
  • A warning: an unknown field, a hidden file, a build folder, game page or build page with no entry, or an absolute URL in the code that is not loaded.
  • Not checked, so check it yourself: the game fits its window, plays through with keyboard and with touch, starts, ends and restarts, stays quiet before the first input, prefixes its storage keys, and uses only material you may publish.

Do not

  • Edit anything in public_html/ by hand.
  • Edit sitemap.xml, llms.txt, anything in public/games/, or the parts of index.html between arcade: comment markers. Publish overwrites them.
  • Change another build's folder or entry, or the site's own files, to add a game.

Undo a publish

Each publish folder in .deployments/ has a files.txt that lists what it added and updated. To take one back, copy the files from its before/ folder over public_html/ and public/, and delete the files listed as add.

Submit by API

A contributor without access to the server sends a build over HTTPS instead. Nothing sent this way goes live by itself: it is held as a draft until the admin has played it and approved it. The same game rules, cover and entry apply.

Every request carries your contributor key. Keys are given to approved contributors: ask at play@smashi.app. Keep the key private, like a password.

  1. Zip the build folder. index.html at the root of the zip, or inside one top folder. 5 MB or less unpacked, no file over 2 MB, static files only.
  2. Write the entry as JSON, with the fields of Games list entry. entry is /arcade/<id>/ and image is a file inside it.
  3. Send both as one form: the field entry and the file build.
  4. Check on it until its status is approved or rejected. A rejection comes with the reason; fix the build and send it again under the same id.
Send a build
curl https://smashi.app/api/submit.php \
  -H "Authorization: Bearer $SMASHI_KEY" \
  -F "entry=<entry.json" \
  -F "build=@my-build.zip"
See where it stands
curl "https://smashi.app/api/submit.php?id=<id>" \
  -H "Authorization: Bearer $SMASHI_KEY"
202
Received and held as a draft.
401
The key is missing, wrong or revoked.
409
The id is taken by a published build or by someone else's submission.
413
The zip is over 6 MB.
422
The entry or the zip breaks a rule. error says which.
429
More than 20 submissions in a day.

Without ?id=, the second request lists all your submissions. The full check of Check and publish runs when the admin approves, so a draft that was received can still be turned down by it.

Change or remove a build

  • Replace the files: put the new files in public/arcade/<id>/, keep the id, and publish. If the game was built again, update buildSeconds and builtAt so they describe the new run.
  • Different prompt or model: that is a new build. Give it a new id and its own entry.
  • Change the entry: edit it and publish. The build's page follows, and so does its share image when the title, model, harness or build time changed.
  • Never rename an id or a title. Links to /games/<game>/<id>/ and /arcade/<id>/ would break.
  • Remove: delete the entry and publish, which takes the build out of the library, the sitemap and llms.txt. Then delete the build's two folders, arcade/<id>/ and games/<game>/<id>/, from public/ and from public_html/; if it was the game's only build, delete games/<game>/ instead. The check names any page folder that is left over. Publish never deletes, so this is the one time live folders are removed by hand.

For crawlers and AI agents

Everything the library shows is also available without running scripts. Publish regenerates all of it from the games list.

  • /llms.txt: what the site is, and every build with its prompt, model, harness and build time, in plain text.
  • /arcade/games.js: the games list itself.
  • /games/: every game on one page, a page per game at /games/<game>/ that lists its builds, and a page per build at /games/<game>/<id>/. Each has its own title, description, share image and schema.org data, breadcrumbs included.
  • /sitemap.xml: every page, including each build's page and the game itself.
  • /robots.txt: all crawlers are welcome, AI crawlers included.
  • The home page carries the same list as plain HTML links and as schema.org structured data.

Checklist

Before you publish
[ ] Folder is public/arcade/<id>/ with index.html at its root
[ ] Static files only, 5 MB or less, no file over 2 MB
[ ] Every file is loaded by a relative path; nothing comes from another site
[ ] Fills any window from 320 x 480 up and never scrolls
[ ] Plays start to finish with keyboard alone and with touch alone
[ ] Start screen, win or lose state, restart without reloading
[ ] No sound before the first input
[ ] Storage keys start with <id>; storage is never cleared
[ ] assets/cover.webp is 1280 x 720, 200 KB or less, subject in the middle
[ ] Entry is first in games.js, with all ten required fields and no null
[ ] title, model and harness match the spelling already in the list
[ ] prompt is word for word; buildSeconds and builtAt describe this run
[ ] node tools/arcade.mjs check <id> reports 0 errors
[ ] node tools/arcade.mjs publish, then one full round from /games/<game>/<id>/ on the live site

The site itself

None of this is needed to add a game. It is for whoever looks after the arcade's own pages: what the site's files are, how its sound works, and the tools that make its music, cursor and share image.

Files

public/index.html
The home page. Publish rewrites the parts between arcade: markers.
public/arcade/
The site's styles, scripts, fonts and music, next to the build folders.
site.css
Styles for every page. docs.css adds this page's.
fx.js
Effects, sound effects and music.
library.js
The home page: the library, the game carousel, the build details and the scoreboard. actions.js runs the Play and Copy buttons on every page.
score.js
The stars and the averages, on every page that shows a build.
menu.js
The menu button of narrow screens, on every page.
builds.js
The filters and the order of /builds/. picker.js is the filter control it shares with the library.
audio/
The music track. tools/music.mjs writes it.
public/about/
The About page: why the site was made and its mission. Written by hand, with the styles of this page.
public/docs/
This page. When a rule changes, change it and tools/arcade.mjs together.
tools/
Everything that is run by hand, from the home directory.
emblems/
The pixel marks of models and harnesses, drawn into their cards and pages.
page.html
The frame of every generated page: /games/, /builds/, /models/, /harnesses/ and the pages under them. The menu and the footer links of those pages are here.
music.mjs
Makes the music track from a recording.
cursor.mjs
Draws the pixel cursors.
public/api/
The two server-side pages: scores.php (votes) and submit.php (submissions).
app/
Their shared code, lib.php, and the admin's command, drafts.php. Not served.
data/
The database of votes, keys and submissions, and the drafts waiting for approval. Not served, and readable by the site's own account only. Back it up; it is not rebuilt by publish.
og/
Draws the site's share image and icons.
music/
The master recording of the music. Not served.
AGENTS.md
The private developer notes, for the agents and people who work on the site: the rules every agent follows, the owner's standing decisions, how changes are tested, mistakes already made and what is still open. Not served. CLAUDE.md beside it points to it. Read it together with this page.

All of this lives in the site account's home directory on the server, and nowhere else: there is no repository, so the server is the only copy. Work continues from any machine that can reach that account.

Pages and menu

The menu is About, Games, Builds, Models, Harnesses, Docs. It is written in four places: tools/page.html for the generated pages, and by hand in public/index.html, public/about/index.html and public/docs/index.html. Change all four together, and the footer links with them. The header is the same on every page: the logo, the menu and the FX, SFX and Music switches. Below 1000px wide there is no room for the links, and a menu button takes their place and opens them as a panel under the header. The button, #menu-toggle, is in each of the four files too, and public/arcade/menu.js runs it. Without scripts the button stays hidden and the footer carries the same links.

/games/
One card per game. /games/<game>/ compares its builds, best score first.
/builds/
Every build, with filters for game, model, harness and effort, and an order: newest, top score, fastest or slowest build.
/models/
One card per model, best score first. /models/<model>/ has its builds, games, harnesses, efforts, average and fastest build time, and score.
/harnesses/
The same for harnesses, with the models that used each.

<model> and <harness> are the names in lowercase with hyphens, made the way a game's address is: Claude Fable 5.2 is at /models/claude-fable-5-2/. Publish writes all of these from the games list; never edit them by hand. Publish does not delete: if a model or harness is renamed in the list, its old page stays live until its folder is removed from public/ and public_html/ by hand.

Filters are part of the address, so a filtered list can be linked to and shared. /builds/?model=GPT-6.2+Astra&harness=Codex&sort=Top+score opens with those choices made; the keys are game, model, harness, effort and sort. The home page's library takes game, model and harness the same way, as in /?harness=Codex#library. A value that is not in the list is ignored.

A filter menu is never cut off. Each filter is a <details> filled in by public/arcade/picker.js. Its menu opens under the button, lined up with the button's left edge and as wide as its longest value, up to 340px. When it opens, picker.js measures it, and if it would run past the right edge of the window, it adds the class flip so the menu lines up with the button's right edge instead (.picker.flip fieldset in site.css). Below 640px wide every menu is exactly as wide as its button, and flip changes nothing. Keep both rules when you change the filters: a menu fixed to one side of its button runs off the window on the other side when its values are wider than the button.

The scoreboard on the home page (1024px and wider) has a row per model and harness with the average score of its builds, best first. A row is a link to the library filtered to that pair.

What publish covers

Publish copies arcade/, about/, api/, builds/, docs/, games/, harnesses/, models/ and six files at the root: index.html, robots.txt, sitemap.xml, llms.txt, og.png and favicon.ico. Anything else in public/ goes live only when it is copied to public_html/ by hand.

The hash that publish stamps on a link, as in site.css?v=295bcd1cee, changes when the file does. A browser fetches a changed style or script at once and keeps an unchanged one, so there is no version number to raise by hand. The scripts also import each other and the games list by plain address, so each page carries an import map that points those addresses at the stamped ones: a visitor never sees counts or a carousel from an old games list.

Emblems

Each model and harness has an emblem on its card and its page: the mark of its maker, redrawn on a 24 by 24 pixel grid in one colour. The files are tools/emblems/<name>.svg, and the EMBLEMS list in tools/arcade.mjs says which names get which file. A name with no rule gets its initials in the pixel font. To add one, save a 24 by 24 one-colour SVG that uses currentColor there and add a line to the list. The marks belong to their owners and are used only to say which product made a build.

Share images

Every page has its own image for link previews in chat apps and on social sites, a 1200 by 630 share.jpg in the page's folder, named in the page's og:image. Publish draws them all with the same card: games and builds over their own covers, a model or a harness over its first build's cover, and /games/, /builds/, /models/, /harnesses/, About and this page over the first game's cover. The home page uses og.png. An image is drawn again only when its words or its cover change. A chat app that has already fetched a link keeps its old preview for a while.

Effects and speed

The effects are written to cost nothing while nothing is seen, and to leave the drawing to the browser where they can. The starfield stops when it is off screen or in a hidden tab, draws 20 times a second unless the pointer is steering it, and draws one canvas pixel per CSS pixel, scaled up crisp. The marquee's drift is an animation the browser runs by itself; scripts touch it only while the page scrolls. The title's letters hop in a short wave started by a timer every seven seconds, not by an animation that runs for ever. The cursor brackets stop when they have settled. Sections, menus and the build dialog appear with short smooth animations of opacity and position only. Keep new effects to the same rules: use loop() from the effect's context and stop it when there is nothing to draw, animate only opacity, transform and translate, and never leave an endless animation running out of sight.

The check also parses the site's own scripts in public/arcade/, so a script with a syntax error stops the publish.

Game covers

The carousel shows one cover per game, /games/<game>/cover.jpg. The build step draws it as a mosaic of the covers of the game's builds, the first six in the games list at most, and draws it again when those change. To use a picture of your own, save a 1280 by 720 JPEG under that name in public/games/<game>/: a cover the build step did not draw is left alone.

Numbers

Counts are written as they are: 3 games, build 1, Game 2/3. No leading zeros anywhere on the site, section numbers included. Clocks keep theirs (00:01:16).

Scores

A visitor rates a build from 1 to 5 stars and can change the vote later. public/arcade/score.js shows the stars and the averages, and /api/scores.php keeps them. A game's score is the average of all the votes on its builds. The carousel on the home page shows the best scored game first; what nobody has rated follows in the order of the games list. It moves only when its arrows are pressed, and its play button opens a different build of the game at random each time.

  • One vote per build per browser. The browser makes up a random token and keeps it. No account, no name, no email.
  • Capped per network. At most 5 browsers on one network can rate the same build, and one network can cast 60 votes an hour.
  • Nothing personal is stored. The token and the network address are kept only as one-way hashes, salted with a secret that never leaves the server. A vote is a build, two hashes, the stars and the time.

php app/drafts.php votes lists the scores as stored, and php app/drafts.php votes reset <id> removes a build's votes.

Drafts and approval

Builds sent through the API wait in data/drafts/. The admin decides on each one from the home directory. There is no admin page on the web.

php app/drafts.php key add <name>
Makes a contributor's key and shows it once. key list and key revoke <name> go with it.
php app/drafts.php list
The drafts waiting. --all adds the approved and rejected ones.
php app/drafts.php show <id>
The entry and the files of a draft.
php app/drafts.php preview <id>
Puts the draft at an address nobody can guess, /arcade/draft-…/, to play it. Crawlers are kept out.
php app/drafts.php approve <id>
Adds the build and its entry, runs the check and publishes. If the check finds an error, nothing is changed and it stays a draft.
php app/drafts.php reject <id> "<reason>"
Turns it down. The contributor sees the reason and can send it again.

An uploaded zip is unpacked file by file: paths that leave the folder, hidden files and server-side code are refused, and the size limits of the game rules apply.

Visitor statistics

The site's own pages load the Inistats tracking script once the page has finished loading: the home page, About, this page, /games/ and every game and build page. The snippet sits just before </body> in public/index.html, public/about/index.html, public/docs/index.html and tools/page.html. The games themselves do not load it: a build loads nothing from other sites.

Every press of a Play link is counted as a goal named play, with three properties: build (the id), game (the title) and model. Nothing about the player is sent with it. The call is in public/arcade/actions.js; the goal has to exist in the Inistats dashboard with the key play for the counts to show there.

Switches and sound

Every page has three switches in the header, this page and About included.

  • FX: motion and visual effects, the pixel cursor included. On, unless the visitor's system asks for reduced motion.
  • SFX: the blips on links and buttons, and the engine sound while the mouse is held on the home page's starfield. On by default.
  • Music: one looping track. Off by default.

Each choice is stored in localStorage as on or off, under arcade-fx, arcade-sfx and arcade-music. It holds on the next page, after a reload and on the next visit; a default applies only until the visitor has used the switch.

Browsers allow no sound on a page before the visitor's first click, tap or key press there, and a site cannot change that. So:

  • Sound effects begin with that first press.
  • Music that was left on keeps playing by itself where the browser allows it. Chrome does when the visitor follows a link within the site.
  • Everywhere else, such as after a reload or on a new visit, the Music switch is still on and the track starts with the first press, from where it stopped if that was in the same tab. A note says so once per tab.
  • Music stops while the tab is hidden, and from the moment a game is launched until the visitor is back on the page.

Music

The track is public/arcade/audio/theme.mp3, with its loop points in theme.json beside it. tools/music.mjs writes both and needs ffmpeg. Publish then puts the track on the Music switch; while there is no track, the switch stays hidden.

node tools/music.mjs music/smashi-arcade-loop.wav
Make the track again from the master. The whole file is the loop.
node tools/music.mjs <file> --start 8 --bars 32 --bpm 120
Cut a loop out of a longer recording: where it starts, in seconds, and how long it is. --length takes seconds instead of bars.
node tools/arcade.mjs publish
Put the track live.
  • What the tool does: cuts the loop, blends its two ends when the recording has music outside the loop, sets a quiet level, and writes a 128 kbit/s MP3 with a quarter second of the loop's far end on each side, so the player can repeat it without a gap. Its last lines say whether the two ends of the loop match.
  • A good source: a lossless file that ends on the last beat of a bar, with no intro, fade or final hit. The current track is 32 bars at 120 BPM, 64 seconds.
  • Volume: LEVEL in the music part of fx.js.
  • Take the music off: delete the two files from public/arcade/audio/ and from public_html/arcade/audio/, then publish.
  • Rights: only music the site may publish.

Cursor

node tools/cursor.mjs draws the arrow and the hand from the pixel maps at the top of the script. It writes four PNG files to public/arcade/, each cursor at 32 and at 64 pixels, and needs ImageMagick's convert. The hot spots are set in site.css. The cursors show only for a mouse and only while FX is on; this page and the games keep the system cursor.

Share image and icons

node tools/og/render.cjs draws tools/og/og.html as public/og.png, the 1200 × 630 image that chat apps show for the home page and for this page. It also makes favicon.ico and arcade/apple-touch-icon.png from arcade/logo.svg. It needs headless Chromium, through playwright-core, and convert. Run it after changing og.html or the logo, then publish. Build pages have their own share images, which publish draws.

House rules

  • No sideways scrolling: every page, and every section inside a page, fits its width from 320 pixels up.
  • Complete without scripts: every page works as plain HTML. Scripts add the effects, the sound, the scores, the filters, the carousel and the build dialog.
  • Wording: the arcade says “Insert joy” where a cabinet would say “Insert coin”, as in “Free play · Insert joy” and “Game over? Insert joy to continue”.
  • Storage: the site's keys all start with arcade-. Besides the three switches, it keeps the credits counter in arcade-plays, the voting token in arcade-voter and the visitor's own votes in arcade-votes.