Zero out the variable and count the number of dice in each variable (1s, 2s, 3s etc.) then assign scores based on those results. Why did I name the variable for pairs and the variable for straight with a "0_ " in front of them? So they would be easier to find when I was setting up triggers.Īlright? Scoring will be in two phases. So lets count them and add them to a variable with a simple name. What this means is that I don't care what position a particular die is in, I just need to know, how many of the six dies are ones, or twos, or threes. The two exceptions are a straight, or three pairs. The other numbers, in general, have no value unless you have three or more of them. Any 5 is worth 50 points, unless you have three or more of them. This means there are fewer combinations we have to consider to determine a score for any particular roll.Īccording to the Scoring Combos card any 1 is worth 100 points, unless you have three or more of them. Unlike other games (like slot machines) the order of the dice makes no difference for scoring this game. If the die is selected, we ignore these two triggers and move on. So if the die is not selected, we zero its value and then assign a new value by picking a random number between 1 and 6. Now we can re-roll only the dice that aren't currently selected by using these triggers: So after rolling the dice, they are each either a number or SELECTED. The nice thing about this state, is that when you unselect by clicking again, the object goes back to its previous state. Remember, our selected state looks like this: It is a simple thing to click on an object and change it's state to selected. Ok, so die_roll_1 is the object, dice_1 is the state, roll1 is the random number. There is also a selected state.Īlright, we have the basic setup and we know how to change the state of each die based on the random number drawn. Notice the "Normal" state is a blank die, and each side is named from 1-6. Change the state of the dice cube to match the random number. We are dealing with a random number from 1-6 drawn 6 times, and a dice cube with six states. I'm not going to spend a lot of time on how to create a rolling dice game with six dice here.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |