Living World Productions
Video Game Blog

March 07, 2019

As I code I test as I go to verify that the logic is working the way it should. I've run into an inconsistent logic bug that I've been trying to figure out why it was not working the way I wanted it to.

It pretty much stems from trying to align the Tile Images within the map in reference to each other, keeping the center Column and Row orientated in the middle of the Play SCreen and be able to accurately hit a Target with the Cursor (Mouse).

Being that everything was suppose to scale according to the dimensions of the Tiles being used, all of the logic should have stayed consistent with each Tile size picked according to the User's monitor size.

But things were not perfect in all versions...and I've been boiling my brain for a few days as to why it did not work like it used to in the old code. I was aligning everything to the Top Left corner of the Play Screen, but the Tiles necessary to cover the dimensions of the Play Screen were changing with the varients and throwing things off - causing an inconsistent measuring point.

I contemplate what's going on while I'm working my 'other' job, and something finally clicked about how the old code worked. Instead of using the Top Left of the Play Screen as the Anchor to measure from, the old code used the center of the Play Screen itself as the Anchor. Yea, the math is a little more complicated to make it work, but this creates a consistent stretch effect that no matter the dimensions of the Play Screen, everything radiates 'away' from the center.

Some minor code changes in the new code and things should clean up the bugs...