dotframe

▸ F 0000 · a game engine

The engine your agent can play.

Write the game once in TypeScript. Ship it to the web, iPhone, macOS, Windows and Discord. Every frame is deterministic, so your agent plays it headless, looks at any frame, and finds the bug before your players do.

$ npm i -g dotframe

then tell your agent: dotframe skills get core

F 0240sum e8e33a79★ 3JUMP

same frame, same sum

▸ 01AHow an agent plays

No screen needed. Until it wants one.

The sim is pure state and a fixed step. An agent mashes inputs through 600 frames in a millisecond and reads the state back as JSON. When it needs to see, it renders that exact frame through the real WebGPU renderer and opens the PNG.

Record a run once and it becomes the test: every change after that has to land on the same checksums. That is how a spill that kept taking lives in a loop showed up, at lives: -12.

Frame 600 of Espresso perfecto, rendered by dotframe snap
what the agent
saw at F 0600
$ dotframe sim --mash 7 --frames 600 --json
{  "ok": true,  "data": {    "frames": 505,    "over": true,    "checksum": 661060014,    "state": {      "phase": "done",      "served": 3,      "drink": "espresso",      "lives": 0,      "verdict": "MUY LEJOS",      …    },    "ms": 1  }}
▸ 02AThe whole contract
game.tsdotframe new my-game --template blank
export function step(game: Game, inputs: number[]): void {  game.frame += 1;  game.players.forEach((p, i: number): void => {    const bits = inputs[i] ?? 0;    p.x = Math.max(20, Math.min(WINDOW.width - 20, p.x + (bits & 2 ? 4 : 0) - (bits & 1 ? 4 : 0)));    p.y = Math.max(20, Math.min(WINDOW.height - 20, p.y - (bits & 4 ? 4 : 0) + 1));  });}

State in. Inputs in. Next frame out.

All the state lives in one object and only changes in step(). That is what lets dotframe replay it, snapshot it, and roll it back for netplay. Render only reads.

▸ 03AOne codebase, five places

No JavaScript engine in the binary.

scriptc compiles your TypeScript to a real native binary over SDL3 and wgpu-native. The web build runs the same code on WebGPU, and 2D games fall back to Canvas 2D on phones without it.

  • 01

    Web

    WebGPU, Canvas 2D on phones

    $ build web

  • 02

    iPhone

    native app, no web view

    $ build ios

  • 03

    macOS

    one binary, SDL3 + wgpu

    $ build macos

  • 04

    Windows

    cross-built from a Mac

    $ build-native.sh windows

  • 05

    Discord

    an Activity in voice

    $ build discord

▸ 04AMade with dotframe
  1. Nº 01
    Espresso perfecto

    Hold, pour, release on the line

    Play ↗Src
  2. Nº 02
    Craft Ones

    1v1 artillery with Peruvian critters

    Play ↗Src
  3. Nº 03
    Crafter Smash

    Platform fighter, bring a gamepad

    Play ↗Src
  4. Nº 04The Ones
    The Ones

    3D horror, 60 fps on an iPhone 15 Plus

    Play ↗Src
▸ 05AShipped one?

Wear the badge.

Put it in your README so the next person finds the engine.

Made with dotframe, lightMade with dotframe, dark
README.md
<a href="https://dotframe.crafter.games">  <picture>    <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/crafter-games/dotframe/main/assets/badge/made-with-dotframe-dark.svg">    <img alt="Made with dotframe" src="https://raw.githubusercontent.com/crafter-games/dotframe/main/assets/badge/made-with-dotframe-light.svg" height="32">  </picture></a>