That's it, I'll say it... UI is hard. Anyone else find it to be one of the more difficult sides of making games?
#gamedev #solodev #gamedevelopment #indiegame #indiedev
#gamedev #solodev #gamedevelopment #indiegame #indiedev
Comments
Where to store information, how it's not just one, but MANY layers of different moving parts. And how you go about making all of it work efficiently... it takes skill.
SINGLE RESPONSIBILITY PRINCIPLE. It saved my filthy soul.
If you're making an "inventory?" Every entry has its own class. Every similar menu derives its own class from a base class.
Use composition to combine very small behaviors, use shallow inheritance and abstraction to unify your code and make it all follow consistent setups.
Example: My inventory menu has the following classes/components, (and additional ones besides)
Grid Manager (Holds UI elements)
Grid Unit Manager (Holds UI entry components)
Grid Node (Positions that UI entries fly to)
Item Reciever
Item Holder
Drag/Drop
Arrow Drag
Stat Display
Text Updater
When you split up your code into focused, single-responsibility classes that only do ONE THING, there are only so many places a bug can be coming from.
The mockup doesn't substitute the actual experience, so it's not even effective, but it's still the only way I know that can at least put you on the right path.