Coding Randomization

Is there anyway to code a random number generator or something similar? I’m making a dice game and I want to make it so that when you click on the die you get a random number 1-6 which impacts how the game progresses. II know it’s possible to do this with Javascript, but I’m not sure about Donacode. Anyone know? @Dara.Amarie you’re the resident Donacode master…any ideas?

What you could do is create 6 buttons to tap on and tell the reader to tap on either button to roll the dice. Each button will represent number 1 - 6 without the reader knowing which button has which number.

Or you can make a bunch of small invisible buttons on the screen, each invisible button represents 1 - 6 and depending on where the reader taps on the screen (thinking they’re tapping the dice but actually a small invisible button) and that’s what number they’ll get


Thanks Dara!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.