Howdy! I am building my first attempt at a game, and it is particularly important that there be a password - Not that I am afraid of people playing the game, but because it is a tradition that in my particular group of friends we always password protect our projects, games, web pages, etc. the same way. Since I’m pretty sure many of my friends have never dealt with a text game, I also want a way to turn on a noob mode.
I wanted to ask two questions before play begins:
“What is the password?”
and
“Are you a text game noob?”
I have two bits of code that start with “When play begins” and when I run the game, it skips the password question and goes straight to the noob question (which seems to work on it’s own.) So I’ve been lurking on the forums and reading the documentation, and this is the code I have so far:
[code]
When play begins:
now the command prompt is “Enter password >”.
After reading a command when the command prompt is “Enter password >”:
if the player’s command matches “password” or the player’s command matches “Password”:
move the player to the detective office;
otherwise:
say “Password denied.”;
move the player to the void.
When play begins:
say “Are you a text game noob? >”;
now novice mode is whether or not the player consents.[/code]
I am lost trying to figure out how to have the game wait for a command from the player before moving on to a different question.
This doesn’t work but is this anywhere closer to what I should be doing?
[code]When play begins:
say “Enter password >”;
now password state is whether or not the player’s command is true.
Definition: The password state is true if the player’s command matches “password” or the player’s command matches “Password”.
Password state is a truth state that varies.
When play begins:
If the password state is true:
move the player to the detective office;
Otherwise:
move the player to the void.
When play begins:
say “Are you a text game noob? >”;
now novice mode is whether or not the player consents.
Novice mode is a truth state that varies. Novice mode is true. [/code]
Probably not. Probably not at all.