I’ve also thought about creating text-based games from time to time, but my plans haven’t yet made it to full production. I believe that there is a niche market for these kind of games and a good text-based game would find its audience.
As usual, that’s some neat looking engine, Ed! My approach to creating a game like this on Corona was probably similar to @roaminggamer’s. I built the entire game around what I call “story blocks”. These story blocks were all located under a table in a separate file that the engine loaded. I added a snippet of the story block code below.
local story = { [1] = { txt = { {"narrator", "The lock breaks as you slam the door behind you."}, {"narrator", "You are in a room with a staircase leading down and rusted iron door in the far right corner."}, }, to = { {"Go down the stairs",2}, {"Try to open the rusted door",24}, {"wait in the room",101}, }, }, [2] = { txt = { {"narrator", "As you make your way down the stairs, you hear banging at the door you just slam shut."}, {"narrator", "You've made it all the way down, but it is too dark to see anything."}, }, to = { {"Try to search for a light switch",3}, {"Hide in the darkness",7}, }, }, -- ... etc. }
The way that I made it to work was for the engine to load a specific story block, e.g. block #1. Then, it would look at the txt table. It would create a text display object for each entry in the txt table. Each entry contained the text type, which was used to format the text, and then there was the text string itself. This made it easy to give different characters different styled dialogue and to make them distinct from the narrator, etc.
Then, the to table included the options that the player could select. First, there was the string that the player would be shown and secondly there was the story block’s number that the player would be taken to.
In my current (frozen) version, there are also systems for inventory, character stats, and party management. It’s really as roaminggamer said, the difficulty lies in making it easy to test and edit. In my version without those fancy management systems, it was easy to just tell the engine to jump to a specific story block, because I knew that the player couldn’t have made it there another way. With the more complex management systems, I had to create a switchboard to toggle certain options on and off, etc.