Help with suggestions on upgrades.

I’m looking to put upgrades into my 2d game. As an example I have a mining machine with 3 upgrades. The machine gets bigger and can mine faster. I thought as to put all upgrades into an upgrade list, cycle through it on start up and then just assign the correct sprites and attributes if that was the case. Then I thought whether to just have 3 upgraded game objects and set them to active when upraded.

The other issue I have is that I want to upgrade what I can mine as levels progress. I want to be mining mineral/rocks and then be able to buy with my game currency potential upgrade materials such as gold, silver, etc. This seems like the method would be completely different to the above but im just looking for a bit of guidance.

Thanks

Check out Scriptable Objects, they’re a great way to handle this sort of thing. You’d create an Upgrades scriptable objects, and attach it to your player. Then inside the scriptable object, you can have functions like GetDrillSprite() which returns the correct sprite based on the current mining upgrade level and CanDrillElement(Iron) which returns whether your drill is strong enough to bore through iron.

It’s also future-proof. If you decide you want to add an engines upgrade now, it’s all stored in one place.

1 Like