Monday, September 7, 2015

Day 14: The Forgotten Day

Unfortunately, yesterday was a busy day (which turned into a forgetful day) that led me to not post yesterday. Nonetheless, two posts will be posted today!

In all oddity, not much happened yesterday in the way of actual programming struggles. In the separation of cities and their values, I utilized a series of subclasses for buildings (making the parent class an empty ShantyTown) and added their values to a city when built and removed them when demolished. Things got a bit tricky, as the costs of the buildings themselves needed to be static to prevent unnecessary instantiation.

The real struggle yesterday was the lack of communication (and proper source control) for the project. The project is now properly integrated (and the city portion is still working beautifully!) but the world still needs a bit of work before it's ready to test and play. Surprises keep suspiciously coming out of the woodwork that sometimes demand an entire restructuring of visual elements, like a neutral force on top of the player and enemy that was never in the design document. Regardless of who or what may have been the cause, such things only promote trouble in the long run, especially for prototypes.

I also learned that just declaring an object to be a new Object() without assigning it to an instance is actually a thing, but I have no idea why you would want to let such a thing roam free without it being a one-trick pony. Turns out eventListeners on those types of unassigned objects stop listening without being consistently referred to by their parent objects. Moral of the story? var object:Object = new Object(). In the realm of memory allocation, this will serve you well.

No comments:

Post a Comment