| CIT 591 Clarifications for Adventure
Assignment 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.
Gorgo
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.
look command so
that look Gorgo works." The problem is that look Gorgo
always 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 Thing.Commands
help." This implies that you need to
add new commands, not just new versions of the use command. New
commands might be, for example, open box, shoot gun,
escape, teleport Room, eat,
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 use box.escape would mean that you, the player, escape from something;
look gun would mean that you, the player, look at the gun. While
look at the gun would be better English, my parser
isn't that sophisticated.key unless 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.Things
gun object, you probably want a shoot gun
command (or maybe a shoot command). But you could equally well
add, say, a run command 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 take, drop,
and inventory, and reasonable default behavior (which you should
probably override) for look and use. If this doesn't
happen, you've done something wrong.Rooms
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.String Comparisons
If you have two Strings you want to compare, say, string1
and string2, you should say string1.equals(string2)
rather than string1==string2. If one of the strings might possibly
be null, use it as the parameter; for example, "key".equals(thing)
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
and strings.