Friday, January 3, 2014

Dev Log: Horror Text Adventure #33

Made various types of barriers into subclasses, the same way I already did for items and room types.  Had a problem with using a class (not an instance) as a parameter, but I realized after a little while I could just pass in a new instance of the class, and it all worked fine.  It works exactly the same as the items and room types, so I kind of reinvented the wheel three times.  So I get to see if that lesson sticks next time I need to do that.

I've also started trying to figure out how to write files, which is one of the main reasons I'm using AIR instead of basic Flash.  I've started with creating a new player txt that will save the player var when the player exits (and hopefully more often than that, just in case of crashes).  I saw some good sample code on StackOverflow, but changing the directory seems to be messing me up a little.  The sample code put the file on the desktop, but of course I'd rather put files in the application directory, preferably in the lib folder or somewhere similar.  However, that's read-only, it seems, so the advice I've seen from official documentation says to use the Application Storage Directory.  Makes sense... until I look for it.  It seems to put it in the middle of nowhere, down a rabbit hole of folders.  The documentation says it puts it in a different folder depending on what system you use (Mac vs. Windows, etc.), but my goodness, something like the installation directory wouldn't be too hard, would it?

Oh, well.  It works; that's what matters at the moment.  The file saves so I can move on from that task.

No comments:

Post a Comment