lc Ludic Canvas0.10.2

PLAYABLE EXAMPLES

Choose your next world.

Two small games. Two rendering engines. Every in-game interface is built with Ludic Canvas.

Canvas 2D world + WebGL UI

Orbital Relay

Open separately

Orbital Relay selected.

INSIDE THE EXAMPLE / 2D

How Orbital Relay uses Ludic Canvas.

The game owns the world.

The application draws the ship, cargo, beacons and debris with Canvas 2D. A transparent WebGL 1 canvas sits above it. Ludic Canvas owns the HUD, manifest, cargo tabs and pause menu.

State flows in. Actions flow out.

React reads immutable simulation snapshots at 10 Hz. Components call game actions to select a destination, boost or pause. Oxanium and Space Mono come from separate interface and mission modules; the UI root combines their generated MSDF atlases.

One application-owned loop.

The loop advances the simulation, draws the world and calls ui.frame(now). ResizeObserver keeps both canvases aligned. Modal scopes isolate pause input, and scene teardown destroys the UI root and removes observers and listeners.

2D integration (abridged)TSX
const ui = await createUI({
  canvas: overlayCanvas,
  autoStart: false,
  fonts: [interfaceFont, telemetryFont],
});
ui.render(<Hud game={game} width={width} height={height} />);

function frame(now: number) {
  game.tick(deltaSeconds);
  world.draw(game, width, height, reducedMotion); // Application-owned Canvas 2D
  // The game model publishes immutable snapshots at 10 Hz.
  ui.frame(now);
  requestAnimationFrame(frame);
}

Explore the Orbital Relay source ↗