Learn to Code JavaScript (Node) with Story Game Programming


Keywords
game, text, adventure, story, interactive, framework, api, education, edtech, writing, language, arts, creative, easy, beginner, terminal, command, line, book, learn, programming, coding, simple, basic, fiction
License
BSD-2-Clause
Install
npm install storyeng@1.0.4

Documentation

#!/usr/bin/env node

const s = require('storyeng')
let p

p = new s.Part('start')
p.onenter = `Welcome to my story game.`
p.oninput = `Name`

p = new s.Part('Name')
p.onenter = `Name's Norman. What's yours?`
p.oninput = e => {
  e.data.name = e.line
  s.tell('Well, nice to meet you {name}.')
}

s.start()