Tuesday, November 19, 2013

Dev Log: Horror Text Adventure #29

Barriers work properly now.  If there is no room nearby, it makes a wall (same as before).  If there is a room nearby, but there are no barriers in that room, then the current room makes a barrier (randomly).  If there is a room nearby with a barrier already set up, the rooms are connected by that barrier.  I believe it's set up by pointer (I hope), rather than duplicating the type.

Also implemented windows fully (as fully as any other barrier type, that is), so now the player can go through a window to get to the next room.  It's identical to a door at the moment.  I'm pretty sure I can find a better way to put the barrier descriptions in.  Right now it's copy-pasting almost identical code a ton of times, varying for direction.  Hopefully I'll figure that out before the 18 if statements balloon into 300.

Also a little code cleanup.  Sometimes I wonder what I was thinking when I have a five line block of code with a variable definition and an if statement that can simply be reduced to one return statement.

No comments:

Post a Comment