Saving & Loading!Changelog:
I've left a bigger gap between this update and the previous one because there were some features and changes I really wanted to put in there that were suggested on Reddit by the user NobleKale, a very active user on r/gamedev. Here is my post on Feedback Friday.
His comment inspired me to make some changes, especially the GUI and a mute button.
So I've improved the borders on GUI elements and changed the colors:
And I've added a mute button as you can see under the inventory button:
Another thing I was thinking about ever since the beginning of this project was an effective and easy way to save and load progress. I had to save the preferences anyway so the game would remember if you disabled the sound.
I decided to make a save & load system that collects all the dynamic data and store it with PlayerPrefs as strings.
This was a bad idea, especially for the inventory and all other item-based collections.
Luckily I found a very handy script that handles serialization (saving) of custom classes very well and saves it to the playerprefs.
This meant I could easily save all items as blobs of data that could be loaded fast at startup.
Everything is saved now if you click the save game button:
As you may have noticed, notification windows and question windows have been improved, the icon has been placed on top and the information is below it.
Here are some examples:
Speaking of treasure chests, all chests are now clickable, even the ones dropped by enemies:
This change is the first towards putting more interactivity in the game besides drinking a potion or two to regain health.
The player sprite has also changed, to a more warrior-like appearance, but there's still a lot of work that needs to be done:
You can now use the full 150 item slots for organizing your stuff!
One last, but very important change I've started on is visual button feedback:
|Note the Adventure button color, the cursor is on it|
Phew, I hope this update wasn't too big.
Please leave a comment or tweet me if someone has a question/suggestion!
I'll post the save/load code if anyone is interested, it should work with any game.