Download

Fantasy console · v0.4

Make a game
in a box
of 128 pixels.

Sixteen colours, a sprite sheet, a tilemap and a sound tracker — with the whole editor drawn inside the framebuffer. What's different is the code you write: plain JavaScript, signatures you can guess, and collision, animation and particles already in the box.

Unzip, run .\run.ps1, and it opens. Or skip all that and use the browser version — it's the same console.

Click the screen · ← → move · Z jump

128×128Screen
16Colours
256Sprites
64Sound effects
New in 0.4

The sample game is an actual game now — title screen, a real ending, and a four-channel chiptune written in the built-in tracker. Every screenshot on this page is a true 128×128 image upscaled by your browser, not a blown-up capture.

The editor is the console

Five tabs, all drawn in 128×128.

There's no window chrome hiding the machine. You boot to a command line, press ESC, and you're editing — code, sprites, level, sound and music, in the same pixels the game gets.

Syntax-coloured code editor

Code

Thirty-two columns of syntax-coloured text, with selection, undo and scrolling written from scratch — there's no textarea under it.

When a cart throws, the line is marked red in the gutter. Your line, not a stack trace through the engine.

The API

Signatures you can guess.

a whole game
let p;

function init() {
  solidflag(0);          // tiles flagged 0 are walls
  p = body({ x: 60, y: 20, w: 8, h: 8,
             gravity: 400 });
}

function update(dt) {
  if (btn(LEFT))  p.vx = -60;
  if (btn(RIGHT)) p.vx =  60;
  if (btnp(A) && p.grounded) {
    p.vy = -160;
    sfx(0);
  }
  p.move(dt);          // sweeps the tilemap
}

function draw() {
  cls(12);
  map();
  spr(16, p.x, p.y);
}

rect(x, y, w, h) takes a width and a height, not two corners. sin and cos are real radians. spr() takes named options — { flipx: true } — instead of four trailing flags. update(dt) gets seconds, so movement doesn't break when the frame rate does.

The rest behaves the way a fantasy console should: fillp patterns, pal, palt, cartdata, sprite flags, eight waveforms.

Batteries, not boilerplate

body() does tilemap physics. anim() does frames. tween(), particles(), camfollow(), shake() and timers are all there and driven for you.

No token limit

Write as much as you like. The constraint is the screen, not the source.

Shipping

Your game becomes one HTML file.

Nothing to host

Export inlines the engine, art, sound and code into a single page. No assets folder, no network requests, no build step. Email it, put it on a USB stick, or drop it on any static host.

Plays on anything

Exported games scale to the screen and grow an on-screen d-pad on phones and tablets. Keyboard and gamepad on a laptop. Same cart, no code changes.

Errors that point at your line

A thrown error reports the line in your cart, marked in the editor's gutter — not a trace through engine internals you didn't write.

Nothing to install

Plain scripts and a static server. The whole toolchain is a folder and a PowerShell script, and the browser version is one file.

Specs

The machine.

Hardware
Screen128 × 128, 16 colours
Sprites256 of 8×8
Tilemap128 × 64 tiles
Sound64 × 32 steps, 8 waveforms
Music64 patterns, 4 channels
Frame rate60, fixed timestep
Practicalities
LanguageJavaScript
Exported game~145 kB, one file
Dependenciesnone
Build stepnone
Editor needsa keyboard
Games run onphone, tablet, laptop

Getting started

Three steps, about a minute.

  1. Download and unzip

    Put the folder anywhere. Or skip this entirely and open the editor in your browser.

  2. Run .\run.ps1

    A static server with no dependencies. It opens the console for you. Any other static server works just as well.

  3. Type HELP

    The sample platformer is already loaded. ESC switches between console and editor, Ctrl+R runs, and EXPORT gives you a page you can share.