What would be an elegant/efficient way to do the following:
In game, in a menu:
Items can get upgraded.
Click on the item to upgrade it.
After clicked on the item, and it is upgraded, it is visually shown by a circle-sprite behind it.
Example:
<sword> X X X (not upgraded)
<sword> O X X (upgraded once)
<sword> O O X (upgraded twice)
I was thinking about the following solution, but it is cumbersome, I think:
+With every creation of the upgrade-menu:
-> place X-sprites on the correct positions.
-> give every X-sprite its own number, so that you know which number is which X-sprite.
+ Sword: Is global variable 'SwordUpgrade' Equal to 1
+ X-sprite: identify the first X-sprite (number 1)
-> UpgradeStar: Set animation frame to Circle-sprite-frame.