Tuesday, March 25, 2014

Dev Log: Horror Text Adventure #44

You can now erase the chalkboard, assuming an eraser is nearby.  It's practically the same function as the draw command, in terms of searching for the items, like the eraser, the chalkboard, and what the player specifically said to erase (that last one will still ne implementation; for now you erase the whole chalkboard).  I wonder how many times I'll make very similar functions before I figure out a way to turn them all into one function.

Making an erase function is actually very involved; a lot more so than I'd have thought.  Actually erasing the chalkboard is just one line, but checking to make sure everything is in place to do so is the long drawn out process.

Now that a classroom might have a few objects in them (chalk, chalkboard, eraser), I also added the possibility of having a classroom during the random creation outside of the school common area.  I think I've lost the chance of random rooms having their types influenced by the surrounding rooms during creation, so I'll have to reimplement that.  I guess code goblins took it.

Next I finally restructured the parser a little so you can type in any case.  I had thought it would be a pain, so I had put it off, not knowing there is a toLocaleLowerCase function built in to AS3.  So much gets taken care of in this language, it's just lovely.

I also cleaned the draw command a little bit so now you only draw what comes after the word "draw".  Before it would take the entire string except for the word draw.  For instance, if you had said "I draw a flower", then the chalkboard would have "I a flower" on it, but now it only has "a flower" on it.

I fixed a silly bug where when you typed a chat command you would get the error message "no command recognized".  That happened from an earlier change in the way verbs work, but I hadn't noticed until now when I was checking to see how the case is affected in chat (it isn't; the chat records exactly what you type in the case you type it in, so you can shout).

No comments:

Post a Comment