"use strict" // Loads the real, unmodified 1MB game into a stubbed browser environment: // sprites.js, data.js, then the inline engine script from index.html. // Returns the vm context; engine globals (S, R, O, step, build, ...) live in it. const fs = require("fs") const path = require("path") const vm = require("vm") function load(gameDir) { const html = fs.readFileSync(path.join(gameDir, "index.html"), "utf8") const dataSrc = fs.readFileSync(path.join(gameDir, "data.js"), "utf8") const spriteSrc = fs.readFileSync(path.join(gameDir, "sprites.js"), "utf8") // The engine is the inline