This is a first-pass example of a system to present fiction as a series of IM interactions. The entire text is predetermined and stored in a couple of javascript arrays.
The text advances either through time (in the case of the non-player character), or by the player typing. During the player's turn, each keypress adds a character to the entry text. Once the player has pressed a number of keys equal to that line of dialog, the text is entered into the chat history and control passes back to the NPC. |
foo
|