Command Prompt on Cue

version 3 by Ron Newcomb

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter 2 - mere details - unindexed

    Section 1 - main

    To decide if the player is pressing SPACE: (- Interrupt_test() -).

    Unobtrusive player variable translates into I6 as "unobtrusive_player".
    The saved optional command prompt is some text that varies. The saved optional command prompt variable translates into I6 as "saved_optional_prompt". The saved optional command prompt is usually "".
    Interrupting key is a number that varies. Interrupting key variable translates into I6 as "interrupting_key". Interrupting key is usually 90. [ a capital Z, for the WAIT command. Needed so "the player's command" isn't invalid on the first turn ]

    Include (-
    Global interrupting_key;
    Global unobtrusive_player;
    Global saved_optional_prompt;

    [ Interrupt_test ch;
        while (1) {
            do {
                interrupting_key = VM_KeyChar();
            } until (interrupting_key < 253);
            !print "code ", interrupting_key, "^";
            if (interrupting_key == ' ' or 13 or 10 or -6 or 127) {
                unobtrusive_player = true;
                rtrue;
            } else if (interrupting_key >= ' ') {
                unobtrusive_player = false; ! then player will take action
                print (string) saved_optional_prompt;
    #IFDEF TARGET_GLULX;
                style bold;
    #ENDIF;
                print (char) interrupting_key;
    #IFDEF TARGET_GLULX;
                style roman;
    #ENDIF;
                rfalse;
            }
        }
    ];
    -) after "Definitions.i6t".