More Updates

I finished the first round of refactoring about a month ago and I think I've settled on a visual style that you might call "Oops All Gradients" or "Monument Valley-Ripoff". I wanted to rewrite my code to be cleaner because initial prototype had a bunch of ugly animation code entangled throughout the whole thing. I also avoided making any sort of visual tweaks prior to getting a full game loop implemented; I have a bad habit of getting distracted by visual elements.

I've gone wild with Singleton patterns in my code, and I have a bunch of Manager classes (BoardManager, GameManager, etc). This works pretty well for something small like this, but I know I'll be coming back and refactoring yet again some time in the future. As it stands, all animations are handled in code via DoTween and callback functions. I could use Unity's built in animation stuff (key frames on properties are great!), but I haven't devoted enough time to figure it out yet. I'm sure it's relatively simple, but I haven't been able to figure out how to use the AnimationController state machine stuff to just trigger a single animation without having to do a bunch of state transition and blending stuff.

I had a really great talk with some of my game dev friends, and they suggested moving to an MVC-type architecture. The idea is to move all of the game logic into it's own class/dll and completely abstract it from specific visual representation and input. Communication between the game model and Unity would be handled through input functions and a bunch of event hooks made available to an intermediate controller that would take care of telling Unity what to display. I'd lose a little bit of development/prototyping speed due to having to duplicate some of the state logic in the controller, but it would really help clean up my code and enforce separation of concerns. I could also easily write something to fuzz test game logic, or make a command line version of the game.

I've created a page specifically for this project, which I'm going to call "Blocks" (until I can think up a better name that won't run afoul of copyright claims).