Specifies that the adventure pauses for a specified amount of time, until the user presses a key, or both.
Syntax
Wait time, keypress
where
time | Specifies the amount of time the adventure pauses, in seconds. |
keypress | Specifies the key that, when pressed, pauses the adventure. |
Remarks
The time and keypress arguments are both optional, but you must specify one or the other. If you specify time only, the program pauses for the specified time regardless of any key the user presses. If you specify keypress only, the program waits until the user presses a key. If you specify both time and keypress, the program waits for the specified time or until the user presses a key, whichever comes first.
If you specify keypress, Wait always updates the Key variable with the key that was pressed or with 0 if the time limit specified by time expired. You can use Wait 0, keypress to check whether or not a key was pressed during regular program execution. If you don't specify keypress, the Key variable is updated if the user presses a key, but it is not cleared if the user does not press a key. As a result, you can check Key after a series of Wait commands without the keypress keyword to see if a key was pressed at any time in the sequence.
Note: The Wait command can only identify keys specified by Adv_Keys.
Example
WAIT 10
ADV_KEYS ADD, KV(CTRL "r")
WAIT 15, KEYPRESS