Living World Productions
Video Game Blog

June 18, 2019

Working with the Editor, having to account many many potential phases that it might have to work on has caused a lot of Spaghetti Code. I decided to stop and address this problem, as it's unprofessional for one, and secondly if another programmer looked at it, they would say "What the f*** !!".

In the previous version, the various buttons would flip purposes according to what stage the map editor was in. The first major overhaul was to just make a simple "tree" of options that the game state might be in. Within each of these branches, I then did a subdivision of tests of what the User was interacting with. The code for the buttons that appear to not have changed have their special purpose enacted within the particular branch the User is at. Yes, there's a tiny bit of copying of code...but it's cleaner, and the flow is understandable.

It's going to take a little while to move code around and retest everything to ensure that it works like before. So...be patient...