Posted March 10, 2021 by Eli Vazquez
#Bug #Bug Fix
Over the past few weeks, I had been stumped by a bug some players were reporting. Apparently, the game would crash as soon as they hit "New Game." I had been unable to solve this issue for weeks, but, after one commenter posted a detailed account of their experience with the bug, I was finally able to fix it! Thanks to user MEA0W for posting the comment that lead to the solution!
Originally I thought that the bug was being caused by the save system, since the game creates a blank save file as soon as you hit new game. Some players were reporting another bug involving losing their save file, so it seemed reasonable that the save system might just be broken. But using a try catch to prevent crashing in case of a failed save didn't fix the problem, as players continued to report the bug. I assumed that it was still probably being caused by the save system, and that it was just something on the user's end, like file writing permissions or something, so I felt pretty helpless to do anything about it for a few weeks.
That is, however, until a commenter mentioned that the issue only happened after changing their settings in the options menu, and that reverting to the default settings fixed the issue. This reminded me that the first commenter who reported the issue mentioned that they changed the controls before hitting "New Game" and getting the crash. After some trial and error, I discovered that the problem wasn't the save system at all, but rather the explosion effect which occurs when you press the "New Game" (see the above gif). The problem was that you could change the prompt in the bottom left corner by changing the controls in the options menu. If you set jump to something that contains lowercase letters, like "Space", then the game would crash because the game's font only has capitals, and I didn't think to convert the string to upper case when generating the explosion pixels. What an embarrassing mistake!
Hopefully this cautionary tale will help prevent some bug in your own game, or perhaps find the solution to some bug you're hunting right now. Anyway, the fixed version of the game is out now if you want to try it.