How do I code a better upgrade UI?

0 favourites
  • 3 posts
From the Asset Store
Bring a cool, frosty look to your game with the Frosty UI Kit.
  • Hi, I'm not asking to fix what I have since it's not well made, but I'd like to hear some options on how to make this better?

    I'm using way too much code to make a simpler upgrade UI that there must be a better way.

    This is what I have right now and it's only to upgrade 3 weapons and health / shields.

    I'm needing to have to swap weapons and more stuff down the road and the way it is now it's going to be hell.

    My foundation of all this may just not be the right way to go aswell.

    Right now I have all my weapon stats in instance variable on a sprite for each weapon. Once I add more weapons for the player and enemy it's going to get complicated, I'm using the same weapons for the player as the enemies right now.

    The system I have now is this:

    The UI pops up and I set all the variables to a tmp variable incase they reset the changes.

    Once they accept (close the UI) I then set the tmp variables back to the spriet that the player uses.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • This looks fine to me. If you're going to add more weapons then you just slot the extra weapons into the events easily. It only looks confusing to me because they're called weap1 weap2, if you use the actual weapon names it might be easier to manage.

    Also to control some of the upgrade logic it may be useful to just have levels for the weapons so that if it's level 2 then it has defined stats, you hit upgrade and it becomes level 2. that way you might only have to store the single level variable as a temp, then when you apply it on leaving the UI it applies the level to the weapon which then just applies all the predetermined damage stats.

    I would say you could use arrays instead but I don't think that would save much time since you would be updating array positions instead of instance variables and would be about the same amount of logic.

  • Yeah, I changed the weapon names to the correct ones now.

    Ah good idea about the weapon levels.

    Thanks!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)