Friday, October 17, 2014

Latchkey #60 - Recoding Examine and Move Commands

The good thing about pausing on programming and coming back to it is that problems are easier than you feared.  The bad thing is that you forget how much you already coded and write lots of extra code before seeing that you've already written it once.

I fixed up the Examine command a bunch so it's a bit cleaner and appropriately displays barriers when you ask.  Though, at the moment, it basically reiterates what you already know in the directional box, because adjectives haven't been properly implemented.

Next I started to work on movement, to get that fixed.  Since the common way to move would be to say "move [direction]", I had to go back into the parsing function to peel out directions separately from anything else (I thought I'd have to, but forgot about it).  This gave the added bonus with the examine code, so now the player, when examining a barrier, they don't have to say "look at door", but can just say "look north" and get a description of the barrier in that direction.  Oddly, you can't say "look up" or "look down", but must say "look above" or "look below" instead.  Right now if you say "look up" it lists all the items in the room, which is more or less the error message saying "I know you're looking at something, I just don't know what."  I'll add that to my bug list.  Too annoying just now to fix.

Bigger bug that needs fixing: just typing the work "look" without anything you want to look at causes a crash.  Oops.

In any case, movement now works again (except for the same error with the examine command: you must say "above" and "below" instead of "up" and "down")... and the crash.  Seems to be if you just type a verb and nothing else, you get a crash.  Don't know why yet.  So that'll be fun.

The code is getting big and ugly.

No comments:

Post a Comment