|CIT 591 Clarifications for Adventure
David Matuszek, Fall 2002
The following are explanations of things that some people seem to be confused about. There are no new requirements here; the intent is to clarify the existing requirements.
You are not Gorgo!
Gorgo is a Neandertal (cave man) who wanders around the game doing random things, and mostly gets in your way. When, for example, Gorgo takes the key, you can't take the key; if you want it, you have to wait for him to drop it again.
Unless you want to change that part of the program (which would be fine with me), there isn't much you can do about Gorgo.
lookcommand so that
look Gorgoworks." The problem is that
look Gorgoalways produces "I don't see it here." regardless of whether Gorgo is in the room with you or not. You should be able to look at Gorgo and get a description of some sort if he is present, and not if he is in some other room. This is a bit of a challenge because Gorgo is not (and should not be) a
help." This implies that you need to add new commands, not just new versions of the
usecommand. New commands might be, for example,
eat food, etc. If it makes sense to use the verb
use, it would be a good idea (though not required) to overload it:
use gun, but probably not
escapewould mean that you, the player, escape from something;
look gunwould mean that you, the player, look at the gun. While
look at the gunwould be better English, my parser isn't that sophisticated.
keyunless you are holding it and your are somewhere that there is something to lock. You shouldn't be able to shoot a gun unless you are holding it.
gunobject, you probably want a
shoot guncommand (or maybe a
shootcommand). But you could equally well add, say, a
runcommand that takes you to some randomly chosen adjacent room, and this would have nothing to do with any particular object.
Thing), you will automatically get the correct behavior for
inventory, and reasonable default behavior (which you should probably override) for
use. If this doesn't happen, you've done something wrong.
Room, but this only makes sense if there is some new behavior you want to add for a room. In general, though, you should read my code and create your rooms the same way I did.
If you have two
Strings you want to compare, say,
string2, you should say
string1==string2. If one of the strings might possibly
null, use it as the parameter; for example,
is better than
thing.equals("key"). This will avoid some
problems which we will talk about in class when we get to the lecture on characters