Pre-release
Adventure.js Docs Downloads
Score: 0 Moves: 0
Tutorial explaining the process of a verb in Adventurejs. tutorial, verb process

Customize Verbs:Process of a Verb

Once the game's parser succeeds in breaking a sentence down into nouns and a verb, it calls game.dictionary.doVerb(verb), which in turn calls verb.do(). Verbs vary in complexity from simple to very complex. They can contain various amounts of specific conditional logic to test whether and how they can be applied. They can also test at multiple points for custom code injections.

    • Apply specific verb logic
      Many verbs share common blocks and patterns, though each verb may also have distinct logic at any point.
      • Apply verb's specific sentence structure logic
        It's common that each sentence structure a verb handles will have some amount of distinct logic. For example, consider the differences in handling input like "look" vs "look at reflection in mirror". One is an intransitive verb with no object that might only need to print the current room description, while the other may need to test for the existence of two assets and the relationship between them.
      • Apply verb's specific sentence structure logic
        It's common that each sentence structure a verb handles will have some amount of distinct logic. For example, consider the differences in handling input like "look" vs "look at reflection in mirror". One is an intransitive verb with no object that might only need to print the current room description, while the other may need to test for the existence of two assets and the relationship between them.
      • Apply verb's specific sentence structure logic
        It's common that each sentence structure a verb handles will have some amount of distinct logic. For example, consider the differences in handling input like "look" vs "look at reflection in mirror". One is an intransitive verb with no object that might only need to print the current room description, while the other may need to test for the existence of two assets and the relationship between them.
      • Apply verb's specific sentence structure logic
        It's common that each sentence structure a verb handles will have some amount of distinct logic. For example, consider the differences in handling input like "look" vs "look at reflection in mirror". One is an intransitive verb with no object that might only need to print the current room description, while the other may need to test for the existence of two assets and the relationship between them.