Closed JamesHDuffield closed 1 year ago
doesn't it make more sense for Upgrades
to not be a component, but for it to modify the numbers on the other components when it happens?
Sounds like a nightmare to display via UI or interact with when leveling up, queries that get 20 different components seem cumbersome.
But the alternative is getting the same upgrade component everywhere for everything. Makes more sense for the engine to know it's own speed and the gun to know it's own fire rate and for the upgrade event to be complex. Oh! Events! https://bevy-cheatbook.github.io/programming/events.html Define an event for each upgrade type and emit that when it happens? That way each upgrade system is discrete?
Events certainly make the splitting up of the upgrading of things cleaner, gave it a go. Main problem is there is now no central place to understand what upgrades have previously been selected. I.E. Need to query a bunch of disparate places to get info for the hud, and the same again to calculate what options to "roll" when leveling up.
Hmm. Good point. Not sure.
Trying to invent a data structure for the upgrades and wanted some ideas if you have any.
Ideally the upgrades can be iterated over, and have a "display name" associated with them, but as properties of this struct that is not very simple or clean.
I've implemented the UI and Selection use cases so hopefully it makes sense,