In MJ, resizing the main window had a significant bug which left ugly graphics artifacts. The solution involved refactoring about 2k lines of code, but now the code is much better organized and should be slightly more efficient. However, clearing away the bugs meant that a design flaw has surfaced – MJ has too many graphics objects. This becomes evident when quickly resizing the window. MJ will lag when drawing the last graphics objects, meaning the middle box with the Wall tiles will be incorrectly sized.
MJ does not have demanding 3D graphics requirements, but consider that mj uses 144 tiles. For MJ’s purposes, those are actually doubled because the wall tiles are merely hidden but still present when taken up for play. Add in the buttons, labels, boxes, etc., and MJ has almost 400 objects. Mac programming guidelines recommend about 100. I hope that eliminating 144 redundant objects will be sufficient, but MJ would still have about 250 objects.
Learning through these bugs was frustratingly long, but I am pleased with how the code has evolved. Optimizing the graphics objects is future work. I would rather get back to adding AI skill levels. I want the AI to have some strategy on top of being the current chicken expert. For now, if resizing the window, I recommend that when you get near the desired size, move the resize handle slowly, allowing MJ some time to draw objects at the desired size.