BLIT386BLIT386

BLIT386

A palette-first WebGPU retro engine for TypeScript, with an automatic Canvas 2D software fallback.

BLIT386

A palette-first WebGPU retro engine for TypeScript, with automatic Canvas 2D fallback.

Get startedDocumentation

BLIT386 is a palette-first WebGPU retro engine for TypeScript, inspired by RetroBlit by Martin Cietwierkowski (@daafu). Primitives, sprites, and bitmap text all resolve color through a shared 256-entry indexed palette for pixel-perfect 2D rendering. WebGPU is the default backend; when it is unavailable the engine automatically falls back to a Canvas 2D software renderer.

Features

Quick start

The fastest way to begin is the scaffolder. It works with npm, pnpm, yarn, or bun and generates a ready-to-run Vite project with the engine installed, a starter game, and local docs:

npm create blit386@latest my-game

Prefer to wire it up by hand or add it to an existing project? Install the package and call bootstrap():

npm install blit386
import { , , , type IBTDemo,  } from 'blit386';

class  implements IBTDemo {
  async (): <boolean> {
    // paletteCreate() returns a palette; paletteSet() installs it.
    const  = .(16);

    .(1, new (32, 0, 128));
    .(2, new (255, 220, 90));

    .();

    return true;
  }

  (): void {}

  (): void {
    .(1);
    .(new (10, 10, 40, 24), 2);
  }
}

void ();

Where to go next

The engine source lives in the blit386 repository on GitHub.

Join the community

On this page