UNPKG

adventure-engine

Version:

Simple text based adventure game library.

39 lines (30 loc) 1.1 kB
//========================================================= // server-text.js: Main executable file for testing adventure-engine server //========================================================= // Author: Mr. Piltin // Version: 0.1.0 // History: // 0.1.0: Initial version //========================================================= require('./src/server/adventure-engine.js').init(test, 3000, false); function test() { let score = 0; setTemplateString("wait", "Press ENTER to continue...%w"); let config = getTerminalConfig(); // config.descriptions.delayChars = true; // setTerminalConfig(config); addCallback(function onInspectMe() { println("Health: " + getThing("me").getAttribute("health")); }); addCallback(function onPrintHighScores(scores) { println("I'm doing my own thing." + scores.length); }); addCallback(async function beforeWelcome() { clearScreen("pictures"); println("SPOOKY", "pictures"); await pause(1000); clearScreen("pictures"); playSong("background.txt", 1); return true; }); }