tisdag 10 december 2019

Menu

I made the first version of the menu, with not so great art. The sprites for the UI was switched but most, if not all, of the functionality remained unchanged. I wanted it to be possible to select your own user name. To eachieve this, I just added a class called "IOstuff". This is responsible for checking if a saved file exists and if so return previously defined user-names. IOstuff saved the setting that is entered in the menu. The saved files are then reloaded when the game starts, in order to transfer data between scenes. At first I was thinking of using static variables for this instead, but it turned out to be so much easier to read and write to files instead. If a read or write fails, an object is returned anyways with some standard data. Therefore, the game is less prone to crashing.

Inga kommentarer:

Skicka en kommentar