Files
foreplay/Readme.org
2026-10-16 23:02:01 +03:00

1.2 KiB

Foreplay — toys to test the water

This is an exhibition of games and tools written in Sex, that are capable to run in the browser.

Layout

The page is static, a toy is one folder, each toy keeps its own Emscripten runtime.

index.html          gallery shell
site.css
site.js             menu, hash, frame, source
toys.json           the menu
toys/<id>/
  <id>.sex
  index.html        what the frame loads
  <id>.js
  <id>.wasm

toys.json is a list:

[
  {
    "id": "triangle",
    "title": "Triangle",
    "blurb": "The basic thing in games.",
    "source": "triangle.sex"
  }
]

id is the folder name and the hash (#triangle). source is the Sex file the source button shows. Leave source out when a toy has nothing to show.

Serve this directory with any static file server:

python3 -m http.server

Opening index.html from disk will not load toys.json.

Adding a toy

  1. Put the program at toys/<id>/<id>.sex.
  2. Compile it with sexc, then Emscripten, and write index.html, <id>.js, and <id>.wasm into that same folder.
  3. Add an entry to toys.json.

The wasm and the generated page stay in the repo, so the gallery is only files.