ohtge

A very basic wrapper for xterm.js to make small console games using a BASIC-inspired API.

Usage no npm install needed!

<script type="module">
  import ohtge from 'https://cdn.skypack.dev/ohtge';
</script>

README

One Hour Text Game Engine

A very basic wrapper for xterm.js to make small console games using a BASIC-inspired API. Docs available here.

Example game.js file

title("test.exe")
loop()

async function loop() {
    while (1) {
        write("Hello world")
        color("yellow")
        const a = await input("Say something?") // `input(string, callback)` syntax also supported
        color("white")
        write("You said " + a)
        write()
        await pause()
    }
}

Setup

  1. Download the zip
  2. Only keep the files you want (typically dist/ + one of the examples)
  3. Make a game!

Made with ohtge