Comments (6)
Only got time for a quick answer right now, sorry! Take a look at https://github.com/curiousdannii/ifvms.js/blob/master/dist/bootstrap.js to see ZVM being used in node.js.
https://github.com/curiousdannii/parchment/blob/master/src/structio/runner.js is used in Parchment on the web.
It's designed to be used with Web Workers (though it isn't yet...), so everything happens with two functions: ZVM.inputEvent() and ZVM.outputEvent().
from ifvms.js.
awesome! thanks for the pointers. this looks really promising!
from ifvms.js.
vm = ifvms.bootstrap.zvm('a.z5',['one', 'two']);
// This seems to work for a few of the examples provided but not for my inform7-> down compile z5 code
console.log(vm.output);
// Now how do I continue on this thread?
vm.inputEvent({ code: 'read' , response: 'three' });
from ifvms.js.
You'll want to write your own event handler... the bootstrap one is very simple because I know what events it will produce. runner.js (in Parchment) handles quite a few more, as does api.js in the same folder.
The read event needs a number of other properties, which is why I add the response text on to the original event object and then give it back to the engine. Which now that I think about it is a really poor design... you should be able to just send back the response text by itself. I'll get around to changing that, eventually.
from ifvms.js.
We can close it here - I've started to work something out -
See https://github.com/jedi4ever/ifplayer.js , still could use your guidance obviously!
from ifvms.js.
Sure thing, ask anytime. The parchment Google group is probably the best place.
Oh, and keep a lookout for changes to the API, it's quite unstable at the moment. If you have any suggestions for improvements to it I'd be happy to hear them.
from ifvms.js.
Related Issues (20)
- Support timed input HOT 1
- Use more ES6 features
- Save/Restore broken in some Z3 games
- Small autorestore issues HOT 2
- First Jigsaw piece is drawn wrong HOT 5
- Support more Infocom HOT 3
- Use ifvms without Glkote-term HOT 3
- Many games don't work properly because the window is too long
- Text input does not work with Polish letters
- zvm.js fails on Windows w/node v9.2.0 HOT 2
- @set_font 0
- An in-range update of yargs is breaking the build 🚨 HOT 1
- An in-range update of browserify is breaking the build 🚨 HOT 1
- Need help upgrading from 0.1.0 HOT 2
- More spec fixes
- Update API to match Quixe HOT 3
- zvm ">command prompt" HOT 3
- Issues with hitchhiker-invclues-r31-s871119.z5 HOT 1
- Autorestore formatting issue
- Use Glk input style for input and echoed input HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ifvms.js.