Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(1 edit)

It works now, but you have to be careful.

An intransitive verb is one that does not require an object, e.g. SLEEP. A transitive verb is one that does require an object, e.g. THROW APPLE. Some verbs may be transitive or intransitive, e.g. JUMP or JUMP CHASM.

Intransitive verbs

If you are using an intransitive verb, use :match "sleep -" {:print "You're not tired."; }

However, if someone enters SLEEP APPLE, the response is "Not right now." That response doesn't really make sense. To do it properly, you really need:

: match "sleep -" {
   : print "You're not tired.";
   : done;
}

: match "sleep _" {
: print "You can't use a noun with that verb.";
}

Or something similar. The order of the two matches is important and the :done; after the first one must be there or it will fall through to the next match and give you a second response.

Transitive verbs

If you are using a transitive verb, use :match "throw *" { :drop; :print "It doesn't go far."; }

However, if someone enters THROW, the response is "Not right now." Once again, that response doesn't really make sense. To do it properly, you really need:

: match "throw -" {
  : print "What do you want to throw?";
  : done;
}

: match "throw *" {
   : drop;
   : print "It doesn't go far.";
}

Either transitive or intransitive

If you are using a verb that may be transitive or intransitive, use :match "throw _" { :print "You jump up and down."; }

However, even here, you really need two matches, as your generic response will vary depending on whether your user has supplied a noun or not. For example:

: match "jump -" {
   : print "You jump up and down.";
   : done;
}

: match "jump *" {
   : print "You can't jump that.";
}

Have I got this right or is there a better (as in more efficient or more elegant) way of doing it?