Tuesday, March 11, 2014

Dev Log: Horror Text Adventure #42

I went back through and deleted all the room subclasses.  I had thought originally that I was doing good object-oriented programming, but really it's much more of a mess than necessary.  Rooms, by themselves, really have no difference.  A bedroom and a hallway are only different in what objects will randomly be placed in them, and other minor universal differences--meaning nothing is ever specifically added to a room type for functionality.  Everything so far just takes a case statement or a boolean switch on instantiation.  I had it that way once but then I decided "hey, I ought to OOP this up."

Next I changed the school into purely an array, rather than having individual variables for every room.  I'll need to use the map for reference more, but I needed to do that anyway for a lot of rooms before this, so it doesn't matter too much.

Then, lots of code cleanup and bug fixing.  All minor things that caused no trouble, just lots of quick little things to fix.  I've also recoded a few variables into enums, but since AS3 doesn't support enums, it requires a lot of extra custom code.  But I think that's ok; after all, I do believe I said last time (or at least I'm saying it now) that readability is far more important than efficiency at this point.

No comments:

Post a Comment