Glulx Input Loops

version 1/101121 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Example: * Any Key to Continue - In this example, we use the character input loop to require the player to press a key to begin playing; we also echo the key pressed.

    Note that the character input loop is here running as a primary input-loop, because it is carried out before the first input prompt.

        "Any Key to Continue"
        
        Include Glulx Input Loops by Erik Temple.
        
        Anticipation is a room. "This game is bound to be awesome."
        
        When play begins:
            say "Press any key to start playing this great game.";
            wait for any key;
            say "You pressed '[keystroke]'.";
            if keystroke is "i", say "[line break]How did you know that 'i' was my favorite key?! Oh well, let's get on with playing this pile of awesome!"