Re:How to program a text adventure in C (2016)
by pickdenis on Sunday March 22, 2020 @12:35PM
(#22656214)
I'm working on a text adventure that is simply hyperlinked HTML pages with some snippets of JS for state management (just a bunch of localstorage get/put) and fancy effects. It's refreshing to go back to using the "kiddie" tools to make things.
[ Parent
| on HN ]
Re:How to program a text adventure in C (2016)
by acdw on Sunday March 22, 2020 @02:10PM
(#22657115)
This is awesome! Do you have the code anywhere? This is the kind of text adventure I want to do but I don't know much js.
Re:How to program a text adventure in C (2016)
by pickdenis on Sunday March 22, 2020 @03:23PM
(#22657759)
I haven't put the code up anywhere yet but here is all of the JS (minus some trivial inline scripts):
tools.js: https://pastebin.com/p7MQE7KD
The rest of it is like:
<p>You stand before a cave.
<p><a href="explore.html">explore the cave</a>