I am creating a dice roller for Shadowrun V5 and was looking for some help on how to make my blocks more elegant.
Attached is a screenshot of the current app and the blocks associated with it.
Right now it works the way I want it, but instead of 6 functioning dice, there will be 30 or 36. You can see that if I scale it up from the current way of doing it, it will be quite unwieldy.
Here is the current and expected functionality:
1. The user clicks on the dice. If they are only rolling 3 dice, they click on the third dice. If they are rolling 6, then the 6th dice, 20 then the 20th, etc.
2. Clicking on a dice initially resets everything: variables, background images.
3. Based on the generated random number, the background of each button is changed to match that number.
4. Glitches and Critical Glitches are calculated and displayed.
I'm sure that there is some logic that can handle a mass amount of dice (like a "for each"), but I am currently unable to wrap my head around it.
Any help would be greatly appreciated. Thanks.