Woohoo! This one wasn't fun to make, but I think it definitely made the gameplay loop smoother and less buggy!
Quick Summary:
- Made Skill Tree Menu save upgrades instead of lazily rewarding you points back
- Fixed Skill Point bug with loading (duplication glitches)
- Added Upgrade Menu that uses paper, money, and skill points for currency
- Added 14 unique upgrades to the Upgrade Menu
- Fixed Local Storage bugs relating to NaN, undefined, empty, or null values
- Made workers automatically start again if loaded from a previous save
- Look at the bottom of this page for the "What's Next?" section!
With the skill point menu only having 11 upgrades total, I wanted to have more progression in the game. For that reason, I decided to make a new menu with broader "worker" upgrades. I made 14 of these upgrades, and will be adding more in the future, such as luck-based upgrades. These upgrades use skill points, paper, and money in order to push for more uses of paper. I needed to add more paper use because there was next to no uses for it up until this update. This took FOREVER to get to work. Please, have fun and comment on the Padlet wall what you think.
Previously in the game, if you bought skill tree upgrades, a counter would gain the points you spent. When you saved the game, it would save that value and then load it when reloaded. This was essentially a band-aid for my laziness, because I didn't want to spend a lot of time making saves. In this new update, I finally addressed the problem and made it ACTUALLY save your upgrades and load them when you come back.
It came to my attention while making this update that the rewarded skill points that you spent and got back when loading got duplicated if you didn't spend them. This was also further made a problem because of local storage also saving this value as the same if you didn't buy anything, so if you refreshed multiple times, you could have thousands of skill points. Yikes!
There was just a bunch of values that had glitchy saved stuff, so I made a function that looked for those and replaced them with correct values. While this system was already in place, it only replaced undefined values, leaving NaN values, empty values, or null values untouched and broken.
This was a simple fix, just a one-liner. I found that the auto clickers or "workers" weren't starting to click automatically when you load the game, I just forgot to call the function off rip.
I'm going to add more upgrades to the upgrade menu; this is ONLY the beginning. I now have the frame to make dozens more upgrades! I also plan on adding a rebirth system, but I don't know when I'll add it, that will probably be after the next update or two.