Hey, that's great! Let me know if you have questions or if you make something you feel like sharing. Have fun!
Benji Kay
Creator of
Recent community posts
Hey, thanks! Happy to help.
If you just want a looping audio file to play five seconds after the page loads, you probably don't need to interface with text-engine at all to do that. I would just add something like this in the script tag of your HTML (or a separate script file if you have more custom code you want to add):
const audio = new Audio('audio_file.mp3'); audio.loop = true; setTimeout(() => { audio.play(); }, 5000);
But if you want it to start 5 seconds after some particular event in the game, such as when the player enters a room, you could put the timeout in e.g. an `onEnter` function or etc. on your disk.
Hope this helps! If you need more help with this let me know.
Hey, if you mean the screen, that was done with CSS. You can see the code for it here: https://github.com/okaybenji/text-engine/blob/master/styles/retro.css
If you mean the computer itself, the OBCOM PCT-II artwork was created by artist Adam Bing.
Hey, sorry for the delayed response! I guess you're right that text games are often written from scratch. Even in my case, I had an idea for a text game I wanted to make before I started writing the engine. But, I thought it would be both beneficial and also fun to structure the code such that it could be used for other games.
Having an idea in mind for a game was really useful for developing the engine, because it gave me a clear picture of the features I would need to implement. You can see this from the very first commit on Github, which included very simple versions of an engine and a game disk to then be expanded upon.
Later, when working on the new features for what would become text-engine 2.0, again I was working in parallel, this time on three new game disks. One of these was what would become the new demo disk for introducing folks to the game, and another was a new story disk I was collaborating on with a friend. Once again, fleshing out those games gave clear direction for which new features to implement next.
It's no bother at all! I'm happy to help. You can use the prereqs to do this. You can make up any arbitrary string as a prerequisite, for instance 'door', and place it on the line you wish to hide, like this:
{ option: 'How do I UNLOCK this door?', line: 'You have to use a key, of course!', prereqs: ['door'] }
Now the option won't show up until some code runs that pushes that prerequisite onto the character's chatLog. You could do this, for instance, in the onLook callback for the door like this:
{
name: 'door',
desc: 'It\'s locked.',
onLook: () => {
const npc = getCharacter('gregory');
npc.chatLog.push('door');
}
}
Now you've met the prerequisite for discussing the door with Gregory (or whatever your NPC's name is). The next time you talk to him, the topic will show up.
This technique is used in the "ur dead" demo. After you learn from the character Fran about how names work in the underworld, it unlocks the ability to ask the other characters you've met what their names are.
If you have more questions, don't hesitate to ask. Like I said, happy to help!
No worries at all! If you're interested, I'd encourage you to check out at how the sound was implemented for the demo here: https://github.com/okaybenji/text-engine/blob/itch/custom/audio.js
It's pretty straightforward, so definitely take a look if you're wanting to do something similar. I can help with this to some extent, so just let me know if you have any questions about it.
You are embedding the wrong link. This is what you should embed: http://benjikay.com/100ng/
Hey, thanks! The game is also hosted here: http://benjikay.com/100ng/
You could embed that page in a frame or iframe if you wanted.
when you say the level 1 screen, do you mean the title screen that says level 1 or level 1 itself? if it's the level itself, are the animations playing? (there should be sparkling stars, characters bouncing a little with idle animations, and a character talking to you explaining the controls.)
which browser are you using, and what version?
Feel free to build it for Windows. The game is open source. https://github.com/okaybenji/goodnight
Thanks for your help. It seems my saves are safe.
I believe I've partially figured out the issue. It seems there is some code in the binary that requires that the filename not be changed. The default filename is "Neon" for some reason. If you change it to "Neon Struct" the game will crash on launch.
I still haven't been able to determine what is wrong with the icon. It was visible at some point but now it's not.
Hmm... so I played the game for a while today, through several levels, saved and quit to come back to it later, and somehow the icon has disappeared again and the game once again crashes every time I try to open it. I did just update OS X to the latest version (10.14.2), but somehow I doubt that's related. Where are the saves stored? If I download the game again will I lose my saves? Thanks.