• Add Review
  • Subscribe
  • Nominate
  • Submit Media
  • RSS

Coding random selections and keeping track of 'em

  • Avee
  • 05/08/2015 05:26 AM
Just a quick blog to show the "behind the scenes" of Bachelors' Deal.
What kind of coding is necessary here?

Several elements must be randomly generated, such as the 10 contestants (out of a pool of 22 characters) and the sums of money that are taken away after each contestant is eliminated.
In the case of the money, I must also keep track of which sums remain and can be selected randomly as the game moves forward and new contestants are eliminated.

-The above screenshot shows how the third sum of money to be taken away is randomly generated (using a variable randomly set from 1 to 10).
-The result is then compared to the previous two sums that were saved, and a reroll occurs if the numbers correspond (Jump to Label 2).
-When the result is unique, the number is converted to the appropriate sum of money and saved into the cash pointer variable. That variable is then shown in a message box, the host revealing the sum of money that was taken away.

There is a lot of this kind of coding going on in the game! So it can get a little tedious but the result makes for an ever-changing gaming experience.


Pages: 1
so many numbers.my head is spinning. XD
Pages: 1