ETHOSBASIC JAVASCRIPT HOST
One program, three places to play.
This page embeds one BASIC runtime into ordinary webpage elements. The main graphics window, radar and optional telemetry stage share the same program. Missing playfields display N/A.
Graphics window
N/A — not opened
Radar · playfield 1
N/A — not opened
Telemetry · playfield 2
N/A — not opened
Click any stage for input. Hold Space to accelerate; Escape exits. Telemetry opens at frame 60, disappears at 180 and returns at 210.
Editor / host OUTPUT
Text console · PRINT / INPUT
N/A — console is closed
Embedding contract
Import createPlayer from src/browser/player.js, provide a canvas plus optional playfield mappings, and call run(source). Your page controls placement and styling. BASIC keeps its original window/playfield syntax.
const player = createPlayer({
canvas: document.querySelector('#main-stage'),
stages: [
{ id: 'radar', playfield: 1, canvas: document.querySelector('#radar') },
{ id: 'telemetry', playfield: 2, canvas: document.querySelector('#telemetry') }
],
outputElement, consoleElement, onSurfaces, onState
});
player.run(source);